From c8ea5028335a1425dddffeb917eaa0b49beae2fd Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 12 Jul 2025 11:35:30 +0530 Subject: [PATCH] removed all lines options in production hourly chart --- app/Http/Controllers/ModulePlantLineController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ModulePlantLineController.php b/app/Http/Controllers/ModulePlantLineController.php index 6b418fb62..2bc80d446 100644 --- a/app/Http/Controllers/ModulePlantLineController.php +++ b/app/Http/Controllers/ModulePlantLineController.php @@ -88,6 +88,7 @@ class ModulePlantLineController extends Controller } $plantName = $request->header('plant-name'); + $chartName = $request->header('chart-name'); if (empty($plantName)) { return response()->json([ @@ -105,6 +106,8 @@ class ModulePlantLineController extends Controller ], 404); } + + // Load only lines NOT equal to FG Line $nonFgLines = Line::where('plant_id', $plant->id) ->where('type', '!=', 'FG Line') @@ -119,8 +122,12 @@ class ModulePlantLineController extends Controller ], 404); } + if (strtolower(trim($chartName)) !== 'production hourly count') { + array_unshift($nonFgLines, 'All Lines'); + } + // Add "All Lines" to beginning and "FG Lines" at the end - array_unshift($nonFgLines, 'All Lines'); + // array_unshift($nonFgLines, 'All Lines'); $nonFgLines[] = 'FG Lines'; return response()->json([