From 91c2bf6bfa84b63f88b09df774812fe61145833b Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 12 Apr 2023 14:16:28 +0700 Subject: [PATCH 1/2] Hotfix hirarki ftth --- app/Http/Controllers/HierarchyFtthController.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/HierarchyFtthController.php b/app/Http/Controllers/HierarchyFtthController.php index 1a3ca56..03b42e6 100644 --- a/app/Http/Controllers/HierarchyFtthController.php +++ b/app/Http/Controllers/HierarchyFtthController.php @@ -140,8 +140,21 @@ class HierarchyFtthController extends Controller $data = HierarchyFtth::where('project_id', $project_id)->whereNull('parent_id')->orderByRaw('id ASC')->get(); $finalData = []; foreach($data as $objRow){ - $objRow->children = $this->getChildren($project_id, $objRow->id); $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; + } + $objRow->children = $this->getChildren($project_id, $objRow->id); $finalData[] = $objRow; } From 23252645c15d1ae7ee9a01785695601cb04a4157 Mon Sep 17 00:00:00 2001 From: ibnu Date: Wed, 12 Apr 2023 15:10:42 +0700 Subject: [PATCH 2/2] update logic progress gantt --- app/Http/Controllers/VersionGanttController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/VersionGanttController.php b/app/Http/Controllers/VersionGanttController.php index 4dc9450..b66dc3f 100644 --- a/app/Http/Controllers/VersionGanttController.php +++ b/app/Http/Controllers/VersionGanttController.php @@ -94,7 +94,7 @@ class VersionGanttController extends Controller $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.type_activity', "project") ->where('m_activity.parent_id', null) ->get(); foreach($progress as $item) {