|
|
@ -445,6 +445,18 @@ class ProjectController extends Controller |
|
|
|
$gantt = MasterFunctionsHelper::getLatestGantt($id); |
|
|
|
$gantt = MasterFunctionsHelper::getLatestGantt($id); |
|
|
|
$result->projectManager = User::where('id', $result->pm_id)->value('name'); |
|
|
|
$result->projectManager = User::where('id', $result->pm_id)->value('name'); |
|
|
|
$result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $gantt['last_gantt_id'])->first(); |
|
|
|
$result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $gantt['last_gantt_id'])->first(); |
|
|
|
|
|
|
|
// dd($result->header->start_date); |
|
|
|
|
|
|
|
$ganttId = $gantt['last_gantt_id']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$startDate = Activity::where('version_gantt_id', $ganttId) |
|
|
|
|
|
|
|
->orderBy('start_date') |
|
|
|
|
|
|
|
->value('start_date'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$endDate = Activity::where('version_gantt_id', $ganttId) |
|
|
|
|
|
|
|
->orderByDesc('end_date') |
|
|
|
|
|
|
|
->value('end_date'); |
|
|
|
|
|
|
|
$result->header->start_date = $startDate; |
|
|
|
|
|
|
|
$result->header->end_date = $endDate; |
|
|
|
return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$gantt], 200); |
|
|
|
return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$gantt], 200); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|