Browse Source

Merge pull request 'staging' (#242) from staging into general

Reviewed-on: ordo/adw-backend#242
pull/3/head
farhantock 11 months ago
parent
commit
a2061980f2
  1. 13
      app/Http/Controllers/ProjectController.php

13
app/Http/Controllers/ProjectController.php

@ -519,12 +519,12 @@ 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)->whereNotNull('actual_end')->exists();
$actualEndExist = Activity::where('proyek_id', $id)->exists();
$query = Activity::where('proyek_id', $id);
} 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();
$actualEndExist = Activity::where('version_gantt_id', $ganttId)->whereNotNull('actual_end')->exists();
$actualEndExist = Activity::where('version_gantt_id', $ganttId)->exists();
$query = Activity::where('version_gantt_id', $ganttId);
}
@ -533,11 +533,10 @@ class ProjectController extends Controller
} else {
$startDate = $query->orderBy('start_date')->value('start_date');
}
if ($actualEndExist) {
$endDate = $query->orderByDesc('actual_end')->value('end_date');
} else {
$endDate = $query->orderByDesc('end_date')->value('end_date');
if($actualEndExist)
{
$maxEndDate = $query->max('id');
$endDate = $query->where('id',$maxEndDate)->first()->end_date;
}
$plannedStart = Activity::where('version_gantt_id', $ganttId)

Loading…
Cancel
Save