Browse Source

Merge pull request 'Using current gantt instead of last gantt' (#50) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#50
Reviewed-by: ibnu <ibnu@mail.com>
pull/3/head
ibnu 2 years ago
parent
commit
90dc5d5fdd
  1. 12
      app/Helpers/MasterFunctionsHelper.php

12
app/Helpers/MasterFunctionsHelper.php

@ -54,7 +54,7 @@ class MasterFunctionsHelper {
if(!is_int($request)){
$dataPayload = $request->all();
if(isset($dataPayload['gantt_id'])){
$allGantt = $dataPayload['gantt_id'];
$allGantt[] = $dataPayload['gantt_id'];
}else{
$allGantt[] = MasterFunctionsHelper::getLatestGantt($dataPayload['project_id']);
}
@ -62,7 +62,15 @@ class MasterFunctionsHelper {
$allGantt[] = MasterFunctionsHelper::getLatestGantt($request);
}
foreach($allGantt as $gantt){
$gantt = VersionGantt::where('id', $gantt['last_gantt_id'])->first()->toArray();
if (!isset($gantt['last_gantt_id'])) {
$ganttId = $gantt;
} else {
$ganttId = $gantt['last_gantt_id'];
}
$gantt = VersionGantt::find($ganttId)->toArray();
// foreach ($gantt as $key => $value) {
// Log::info('gantt '.$value.' index '.$key);
// }
if($gantt['calculation_type'] == 'simple') {
// to do
return MasterFunctionsHelper::calculateProgressBasedOnSimple($gantt);

Loading…
Cancel
Save