Added routine and category values in get method
This commit is contained in:
@@ -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 ?? "",
|
||||
|
||||
Reference in New Issue
Block a user