|
|
@ -70,6 +70,17 @@ class ReportActivityMaterialController extends Controller |
|
|
|
"persentase_progress" => $sumReportActivityMaterial/$sumAssignMaterial*100, |
|
|
|
"persentase_progress" => $sumReportActivityMaterial/$sumAssignMaterial*100, |
|
|
|
"updated_by" => $this->currentName |
|
|
|
"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); |
|
|
|
Activity::where('id', $request->activity_id)->update($dataUpdate); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|