From 894f2a0e85ea9b1f673620106fdabfcce7da0131 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 3 Jun 2025 19:32:54 +0530 Subject: [PATCH] Added routine and category values in get method --- app/Http/Controllers/TestingPanelController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/TestingPanelController.php b/app/Http/Controllers/TestingPanelController.php index 22a85a009..882795d9a 100644 --- a/app/Http/Controllers/TestingPanelController.php +++ b/app/Http/Controllers/TestingPanelController.php @@ -385,6 +385,8 @@ class TestingPanelController extends Controller // Get description or empty string if not found $description = $item ? $item->description : ''; + + $category = $item ? $item->category : ''; if ($plantCode === null || $plantCode === '') { // return response("ERROR: Plant Name can't be empty", 400) @@ -421,7 +423,7 @@ class TestingPanelController extends Controller { return response()->json([ 'status_code' => 'ERROR', - 'status_description' => "Item Code not found for plant : $plant->name" + 'status_description' => "Item Code not found in item table for the plant : $plant->name" ], 404); } @@ -433,12 +435,12 @@ class TestingPanelController extends Controller { return response()->json([ 'status_code' => 'ERROR', - 'status_description' => "Item Code not found in master for the plant : $plant->name" + 'status_description' => "Item Code not found in master table for the plant : $plant->name" ], 404); } $output = [ - "mot_model_name" => $description?? "", + "mot_model_name" => $description ?? "", "mot_non_isi_model" => $motorTestingMaster->isi_model ? "0" :"1", "mot_phase" => $motorTestingMaster->phase ?? "", "mot_hp" => $motorTestingMaster->hp ?? "", @@ -451,6 +453,8 @@ class TestingPanelController extends Controller "mot_conn" => $motorTestingMaster->connection ?? "", "mot_ins_res_limit" => $motorTestingMaster->ins_res_limit ?? "", "mot_ins_res_type" => $motorTestingMaster->ins_res_type ?? "", + "mot_category" => $category ?? "", + "mot_routine_test_time" => $motorTestingMaster->routine_test_time ?? "", "mot_res_ry_ll" => $motorTestingMaster->res_ry_ll ?? "", "mot_res_ry_ul" => $motorTestingMaster->res_ry_ul ?? "", "mot_res_yb_ll" => $motorTestingMaster->res_yb_ll ?? "",