Browse Source

fix update status

pull/3/head
wahyu 1 year ago
parent
commit
0ae702ebe5
  1. 11
      app/Http/Controllers/ReportActivityMaterialController.php

11
app/Http/Controllers/ReportActivityMaterialController.php

@ -70,6 +70,17 @@ class ReportActivityMaterialController extends Controller
"persentase_progress" => $sumReportActivityMaterial/$sumAssignMaterial*100,
"updated_by" => $this->currentName
);
if ($sumReportActivityMaterial > 0) {
$data = [];
$reportActivityMaterial = ReportActivityMaterial::where('activity_id', $request->activity_id)->get();
foreach ($reportActivityMaterial as $value) {
$data[] = $value;
}
$actualStartValues = array_column(array_filter($data, function($item) {
return isset($item['report_date']);
}), 'report_date');
$dataUpdate["actual_start"] = min($actualStartValues);
}
Activity::where('id', $request->activity_id)->update($dataUpdate);
}

Loading…
Cancel
Save