|
|
|
@ -123,8 +123,14 @@ class HierarchyFtthController extends Controller
|
|
|
|
|
$objRow->key = rand(1, 1000); |
|
|
|
|
if (VersionGantt::where('hierarchy_ftth_id', $objRow->id)->exists()) { |
|
|
|
|
$dataGantt = VersionGantt::where('hierarchy_ftth_id', $objRow->id)->get(); |
|
|
|
|
$progress = $this->ganttProgress('hierarchy_ftth_id', $objRow->id); |
|
|
|
|
foreach ($dataGantt as $gantt) { |
|
|
|
|
$gantt->key = $objRow->key; |
|
|
|
|
foreach ($progress as $p) { |
|
|
|
|
if ($p->id == $gantt->id) { |
|
|
|
|
$gantt->progress = $p->persentase_progress; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$objRow->dataGantt = $dataGantt; |
|
|
|
|
} |
|
|
|
@ -133,4 +139,15 @@ class HierarchyFtthController extends Controller
|
|
|
|
|
} |
|
|
|
|
return $finalData; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function ganttProgress($column, $value){ |
|
|
|
|
$progress = VersionGantt::select('m_version_gantt.id','m_activity.persentase_progress') |
|
|
|
|
->join('m_activity', 'm_version_gantt.id', '=', 'm_activity.version_gantt_id') |
|
|
|
|
->where("m_version_gantt.".$column, $value) |
|
|
|
|
->where('m_activity.type_activity', "project") |
|
|
|
|
->where('m_activity.parent_id', null) |
|
|
|
|
->get(); |
|
|
|
|
|
|
|
|
|
return $progress; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|