Browse Source

add assign_material_id in API reportActivity

pull/3/head
ibnu 2 years ago
parent
commit
82069a3354
  1. 6
      app/Http/Controllers/AssignMaterialController.php

6
app/Http/Controllers/AssignMaterialController.php

@ -174,10 +174,10 @@ class AssignMaterialController extends Controller
->where('description', '=', $row->material_name)->first(); ->where('description', '=', $row->material_name)->first();
return $val_uom ? $val_uom->uom : null; return $val_uom ? $val_uom->uom : null;
}) })
->addColumn('material_id', function($row){ ->addColumn('assign_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") $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(); ->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){ ->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") $dataPlan = AssignMaterial::select('assign_material_to_activity.id')->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")

Loading…
Cancel
Save