From 5f73a147ea82f3cf83a77e5f8e2f6d8a05f33118 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Thu, 2 Nov 2023 12:15:24 +0700 Subject: [PATCH] update condition type proyek --- app/Http/Controllers/ProjectController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 6540e1a..42bcb6d 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -519,8 +519,14 @@ class ProjectController extends Controller if (isset($s_curve)) { $result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->first(); $actualStartExist = Activity::where('proyek_id', $id)->whereNotNull('actual_start')->exists(); - $actualEndExist = Activity::where('proyek_id', $id)->exists(); - $query = Activity::where('proyek_id', $id); + if($result['type_proyek_id'] === 9) + { + $actualEndExist = Activity::where('proyek_id', $id)->exists(); + $query = Activity::where('proyek_id', $id); + }else{ + $actualEndExist = Activity::where('version_gantt_id', $ganttId)->exists(); + $query = Activity::where('version_gantt_id', $ganttId); + } } else { $result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $ganttId)->first(); $actualStartExist = Activity::where('version_gantt_id', $ganttId)->whereNotNull('actual_start')->exists();