diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index dce8f9e..5655cdb 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -186,14 +186,12 @@ class ActivityController extends Controller $actualStartValues = array_column(array_filter($dataFinal, function($item) { return isset($item['actual_start']); }), 'actual_start'); - - $returnActualStartOrEnd = count($actualStartValues) > 0 ? min($actualStartValues) : null; + $returnActualStartOrEnd = count($actualStartValues) == count($dataFinal) ? min($actualStartValues) : null; }else{ $actualEndValues = array_column(array_filter($dataFinal, function($item) { return isset($item['actual_end']); }), 'actual_end'); - - $returnActualStartOrEnd = count($actualEndValues) > 0 ? max($actualEndValues) : null; + $returnActualStartOrEnd = count($actualEndValues) == count($dataFinal) ? max($actualEndValues) : null; } // return json_encode(["min"=>$minActualStart, "max"=>$maxActualStart]);