From 82069a335478c4f6404c70e3943b1e6a9fa94807 Mon Sep 17 00:00:00 2001 From: ibnu Date: Tue, 7 Feb 2023 10:10:48 +0700 Subject: [PATCH] add assign_material_id in API reportActivity --- app/Http/Controllers/AssignMaterialController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AssignMaterialController.php b/app/Http/Controllers/AssignMaterialController.php index 0f857d6..16f848a 100644 --- a/app/Http/Controllers/AssignMaterialController.php +++ b/app/Http/Controllers/AssignMaterialController.php @@ -174,10 +174,10 @@ class AssignMaterialController extends Controller ->where('description', '=', $row->material_name)->first(); return $val_uom ? $val_uom->uom : null; }) - ->addColumn('material_id', function($row){ - $material_id =AssignMaterial::select('assign_material_to_activity.material_id')->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + ->addColumn('assign_material_id', function($row){ + $assignMaterial =AssignMaterial::select('assign_material_to_activity.id')->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") ->where('activity_id', $row->activity_id)->where('m.description', $row->material_name)->first(); - return $material_id ? $material_id->material_id : null; + return $assignMaterial ? $assignMaterial->id : null; }) ->addColumn('action', function($row){ $dataPlan = AssignMaterial::select('assign_material_to_activity.id')->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")