Browse Source

add property material_id di fungsi datatablesForReportActivity AssignMaterialController dan report_id di fungsi add ReportActivityMaterialController

pull/3/head
ardhi 2 years ago
parent
commit
c8b1c603c7
  1. 1
      app/Http/Controllers/AssignMaterialController.php
  2. 8
      app/Http/Controllers/ReportActivityMaterialController.php

1
app/Http/Controllers/AssignMaterialController.php

@ -130,6 +130,7 @@ class AssignMaterialController extends Controller
"m.description as material_name", "m.description as material_name",
"assign_material_to_activity.activity_id", "assign_material_to_activity.activity_id",
"assign_material_to_activity.type", "assign_material_to_activity.type",
"assign_material_to_activity.material_id"
) )
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->groupBy("m.description") ->groupBy("m.description")

8
app/Http/Controllers/ReportActivityMaterialController.php

@ -29,10 +29,12 @@ class ReportActivityMaterialController extends Controller
$data['assign_material_id'] = $request->assign_material_id; $data['assign_material_id'] = $request->assign_material_id;
$data['qty'] = $this->sanitizeDecimal($data['qty']); $data['qty'] = $this->sanitizeDecimal($data['qty']);
if(!ReportActivityMaterial::create($data)) $created = ReportActivityMaterial::create($data);
return response()->json(['status'=>'failed','message'=>'Input progress report activity failed created','code'=>400]);
return response()->json(['status'=>'success','message'=>'Input progress report activity created','code'=>200]); if(!$created)
return response()->json(['status'=>'failed','message'=>'Input progress report activity failed created','code'=>400,'data'=>null]);
return response()->json(['status'=>'success','message'=>'Input progress report activity created','code'=>200,'data'=>array('report_id'=>$created->id)]);
} }
public function updateStatusStartFinish(Request $request){ public function updateStatusStartFinish(Request $request){

Loading…
Cancel
Save