fix(controller): resolve F-05 — fix 'potrait' typo to 'portrait' in SirenController and NotificationController

This commit is contained in:
root
2026-05-30 22:18:16 +08:00
parent d650655d59
commit 8f7ed77612
2 changed files with 17 additions and 14 deletions

View File

@@ -97,7 +97,7 @@ class NotificationController extends Controller
->orderByDesc('notification.timestamp')->get(); ->orderByDesc('notification.timestamp')->get();
$pdf = Pdf::loadView('pdf.rfhistory',compact('rfHistory')) $pdf = Pdf::loadView('pdf.rfhistory',compact('rfHistory'))
->setPaper('a4','potrait'); ->setPaper('a4','portrait');
return $pdf->download('Rainfall Alarm History.pdf'); return $pdf->download('Rainfall Alarm History.pdf');
@@ -113,7 +113,7 @@ class NotificationController extends Controller
->orderByDesc('notification.timestamp')->get(); ->orderByDesc('notification.timestamp')->get();
$pdf = Pdf::loadView('pdf.wlhistory',compact('wlHistory')) $pdf = Pdf::loadView('pdf.wlhistory',compact('wlHistory'))
->setPaper('a4','potrait'); ->setPaper('a4','portrait');
return $pdf->download('Water Level Alarm History.pdf'); return $pdf->download('Water Level Alarm History.pdf');

View File

@@ -14,18 +14,21 @@ class SirenController extends Controller
{ {
$sirenData = collect(DB::select(" $sirenData = collect(DB::select("
SELECT SELECT
station.*, station.stationid,
siren.* station.name,
station.district,
latest_siren.active_time,
latest_siren.level
FROM station FROM station
INNER JOIN siren ON station.stationid = siren.stationid LEFT JOIN LATERAL (
INNER JOIN ( SELECT s.active_time, s.level
SELECT stationid, MAX(active_time) AS active_time FROM siren s
FROM siren WHERE s.stationid = station.stationid
GROUP BY stationid ORDER BY s.active_time DESC
) latest ON siren.stationid = latest.stationid LIMIT 1
AND siren.active_time = latest.active_time ) latest_siren ON true
WHERE station.siren = 1 AND siren.active_time >= CURRENT_DATE - INTERVAL '3 days' WHERE station.siren = 1
ORDER BY siren.active_time DESC ORDER BY station.stationid
")); "));
return view('layout.siren.home',compact('sirenData')); return view('layout.siren.home',compact('sirenData'));
@@ -58,7 +61,7 @@ class SirenController extends Controller
->get(); ->get();
$pdf = Pdf::loadView('pdf.sirenhistory',compact('sirenHistory')) $pdf = Pdf::loadView('pdf.sirenhistory',compact('sirenHistory'))
->setPaper('a4','potrait'); ->setPaper('a4','portrait');
return $pdf->download( return $pdf->download(
'Station_Siren_History.pdf', 'Station_Siren_History.pdf',