Browse Source

add manpower in project@dashboard

pull/3/head
bnu 2 years ago
parent
commit
ef08830b01
  1. 5
      app/Http/Controllers/ProjectController.php

5
app/Http/Controllers/ProjectController.php

@ -304,7 +304,9 @@ class ProjectController extends Controller
->get(); ->get();
$countData = $data->count(); $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(); $rootActivity = Activity::whereNull('parent_id')->where('proyek_id', $id)->orderBy('version_gantt_id', 'desc')->first();
if($rootActivity){ if($rootActivity){
$actualCost = $rootActivity->biaya_actual ?? 0; $actualCost = $rootActivity->biaya_actual ?? 0;
$progress = $rootActivity->persentase_progress ?? 0; $progress = $rootActivity->persentase_progress ?? 0;
@ -331,9 +333,10 @@ class ProjectController extends Controller
$arr = explode(" ", $val->pm); $arr = explode(" ", $val->pm);
$dataRes['pm'] = $arr[0]; $dataRes['pm'] = $arr[0];
$dataRes['budget_health'] = $val->budget_health; $dataRes['budget_health'] = $val->budget_health;
$dataRes['actualCost'] = $actualCost; $dataRes['actual_cost'] = $actualCost;
$dataRes['progress'] = $progress; $dataRes['progress'] = $progress;
$dataRes['comment'] = $commentActivity; $dataRes['comment'] = $commentActivity;
$dataRes['man_power'] = $manpowers;
} }
if(!$data) if(!$data)

Loading…
Cancel
Save