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

View File

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