From 3d20bdf719eaf262a4f2fd91b98747d5d7c3de65 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 5 Apr 2023 11:55:40 +0700 Subject: [PATCH 1/2] Add key to datagantt --- app/Http/Controllers/HierarchyFtthController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/HierarchyFtthController.php b/app/Http/Controllers/HierarchyFtthController.php index 2953325..b29d298 100644 --- a/app/Http/Controllers/HierarchyFtthController.php +++ b/app/Http/Controllers/HierarchyFtthController.php @@ -118,11 +118,14 @@ class HierarchyFtthController extends Controller $data = HierarchyFtth::where('project_id', $project_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); foreach($data as $objRow){ + $objRow->key = rand(1, 1000); if (VersionGantt::where('hierarchy_ftth_id', $objRow->id)->exists()) { $dataGantt = VersionGantt::where('hierarchy_ftth_id', $objRow->id)->get(); + foreach ($dataGantt as $gantt) { + $gantt->key = $objRow->key; + } $objRow->dataGantt = $dataGantt; } - $objRow->key = rand(1, 1000); $objRow->children = $this->getChildren($project_id, $objRow->id); $finalData[] = $objRow; } From 1ec6a69b9dc074d4c17b7a24ba27bb59e9e9f448 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 5 Apr 2023 15:54:12 +0700 Subject: [PATCH 2/2] Fix project activity type --- app/Http/Controllers/ActivityController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 02bfea2..ab5c490 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -132,7 +132,7 @@ class ActivityController extends Controller 'start_date'=> $project->mulai_proyek, 'end_date'=> $project->akhir_proyek, 'rencana_biaya'=> $project->rencana_biaya, - 'type_activity'=> 'header', + 'type_activity'=> 'project', 'created_by'=>$this->currentName, ]);