From 214c065a345210b59835d7a14b1f74c16945e726 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 28 Sep 2026 08:17:41 +0530 Subject: [PATCH] Added logic for order by fg line in production report --- app/Console/Commands/SendProductionReport.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/SendProductionReport.php b/app/Console/Commands/SendProductionReport.php index d0f9736..7d29995 100644 --- a/app/Console/Commands/SendProductionReport.php +++ b/app/Console/Commands/SendProductionReport.php @@ -142,7 +142,10 @@ class SendProductionReport extends Command foreach ($plants as $plant) { - $lines = Line::where('plant_id', $plant->id)->get(); + // $lines = Line::where('plant_id', $plant->id)->get(); + $lines = Line::where('plant_id', $plant->id) + ->orderByRaw("CASE WHEN LOWER(type) = 'fg line' THEN 0 ELSE 1 END") + ->get(); foreach ($lines as $line) { -- 2.49.1