From ef08830b01f3b9c4609dd9fec1afe8630e78b9ea Mon Sep 17 00:00:00 2001 From: bnu Date: Wed, 3 Aug 2022 03:07:30 +0700 Subject: [PATCH] add manpower in project@dashboard --- app/Http/Controllers/ProjectController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index beb438e..b6adcf5 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -304,7 +304,9 @@ class ProjectController extends Controller ->get(); $countData = $data->count(); + $manpowers = UserToProyek::where('proyek_id', $id)->count(); $rootActivity = Activity::whereNull('parent_id')->where('proyek_id', $id)->orderBy('version_gantt_id', 'desc')->first(); + if($rootActivity){ $actualCost = $rootActivity->biaya_actual ?? 0; $progress = $rootActivity->persentase_progress ?? 0; @@ -331,9 +333,10 @@ class ProjectController extends Controller $arr = explode(" ", $val->pm); $dataRes['pm'] = $arr[0]; $dataRes['budget_health'] = $val->budget_health; - $dataRes['actualCost'] = $actualCost; + $dataRes['actual_cost'] = $actualCost; $dataRes['progress'] = $progress; $dataRes['comment'] = $commentActivity; + $dataRes['man_power'] = $manpowers; } if(!$data)