Browse Source

Fix progress

pull/3/head
Wahyu Ramadhan 2 years ago
parent
commit
39a8fd6b40
  1. 12
      app/Helpers/MasterFunctionsHelper.php

12
app/Helpers/MasterFunctionsHelper.php

@ -99,11 +99,8 @@ class MasterFunctionsHelper {
$maxDate = Project::select('akhir_proyek')->where('id', $request->project_id)->first(); $maxDate = Project::select('akhir_proyek')->where('id', $request->project_id)->first();
$begin = new \DateTime($minDate->mulai_proyek. ' Monday'); $begin = new \DateTime($minDate->mulai_proyek. ' Monday');
$begin->modify('last Monday');
$end = new \DateTime($maxDate->akhir_proyek. ' Friday'); $end = new \DateTime($maxDate->akhir_proyek. ' Friday');
$end->modify('next Friday');
$end->modify('next Friday');
$interval = new \DateInterval('P7D'); $interval = new \DateInterval('P7D');
@ -118,13 +115,14 @@ class MasterFunctionsHelper {
$dates = []; $dates = [];
$tempProgress = 0; $tempProgress = 0;
$tempPlanning = 0; $tempPlanning = 0;
array_push($progressData, round($tempProgress, 2));
array_push($planningData, round($tempPlanning, 2));
foreach($period as $p){ foreach($period as $p){
array_push($progressData, $tempProgress);
array_push($planningData, $tempPlanning);
array_push($dates, $p->format("Y-m-d"));
$tempProgress += $avgProgress; $tempProgress += $avgProgress;
$tempPlanning += $avgPlanning; $tempPlanning += $avgPlanning;
array_push($progressData, round($tempProgress, 2));
array_push($planningData, round($tempPlanning, 2));
array_push($dates, $p->format("Y-m-d"));
} }
$dataResponse = array( $dataResponse = array(

Loading…
Cancel
Save