|
|
|
@ -83,20 +83,9 @@ class VersionGanttController extends Controller
|
|
|
|
|
$dataBuilder = $this->setUpPayload($payload, 'm_version_gantt'); |
|
|
|
|
$builder = $dataBuilder['builder']; |
|
|
|
|
// $countBuilder = $dataBuilder['count']; |
|
|
|
|
$progress = $this->ganttProgress($request->columns[0]["name"], $request->columns[0]["value"]); |
|
|
|
|
$this->ganttProgress($request->columns[0]["name"], $request->columns[0]["value"]); |
|
|
|
|
$dataGet = $builder->get(); |
|
|
|
|
// Loop through $dataGet collection |
|
|
|
|
foreach ($dataGet as $item) { |
|
|
|
|
// Loop through $progress collection |
|
|
|
|
foreach ($progress as $progressItem) { |
|
|
|
|
// Check if both have the same id |
|
|
|
|
if ($item->id == $progressItem->id) { |
|
|
|
|
// Set the progress of $item to the corresponding progress of $progressItem |
|
|
|
|
$item->progress = $progressItem->persentase_progress; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// $totalRecord = $countBuilder->count(); |
|
|
|
|
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet], 200); |
|
|
|
|
} |
|
|
|
@ -108,8 +97,12 @@ class VersionGanttController extends Controller
|
|
|
|
|
->where('m_activity.type_activity', "project") |
|
|
|
|
->where('m_activity.parent_id', null) |
|
|
|
|
->get(); |
|
|
|
|
|
|
|
|
|
return $progress; |
|
|
|
|
foreach($progress as $item) { |
|
|
|
|
if($item->persentase_progress){ |
|
|
|
|
$item->progress = $item->persentase_progress; |
|
|
|
|
$item->save(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function list() |
|
|
|
|