Browse Source

Merge pull request 'Fix getactivity first and last' (#157) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#157
pull/3/head
ibnu 1 year ago
parent
commit
9e695ae2a2
  1. 10
      app/Http/Controllers/ActivityController.php

10
app/Http/Controllers/ActivityController.php

@ -151,7 +151,10 @@ class ActivityController extends Controller
} }
public function getActivityFirst($parentId){ public function getActivityFirst($parentId){
$activity = Activity::where('parent_id', $parentId)->orderByRaw('start_date ASC')->first(); $activity = Activity::where('parent_id', $parentId)->orderByRaw('actual_start ASC')->first();
if (!isset($activity)) {
return null;
}
if($activity->type_activity == "task"){ if($activity->type_activity == "task"){
// Log::info("activity ", [$activity]); // Log::info("activity ", [$activity]);
return $activity->actual_start; return $activity->actual_start;
@ -162,7 +165,10 @@ class ActivityController extends Controller
} }
public function getActivityLast($parentId){ public function getActivityLast($parentId){
$activity = Activity::where('parent_id', $parentId)->orderByRaw('start_date DESC')->first(); $activity = Activity::where('parent_id', $parentId)->orderByRaw('actual_start DESC')->first();
if (!isset($activity)) {
return null;
}
if($activity->type_activity == "task"){ if($activity->type_activity == "task"){
// Log::info("activity ", [$activity]); // Log::info("activity ", [$activity]);
return $activity->actual_end; return $activity->actual_end;

Loading…
Cancel
Save