Browse Source

Merge pull request 'Dev-Farhan' (#15) from Dev-Farhan into staging

Reviewed-on: ordo/adw-backend#15
Reviewed-by: wahyu <wahyu@mail.com>
pull/3/head
ibnu 2 years ago
parent
commit
b20c8e529f
  1. 6
      app/Http/Controllers/HierarchyFtthController.php

6
app/Http/Controllers/HierarchyFtthController.php

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\HierarchyFtth; use App\Models\HierarchyFtth;
use App\Models\VersionGantt;
class HierarchyFtthController extends Controller class HierarchyFtthController extends Controller
{ {
@ -115,7 +116,12 @@ class HierarchyFtthController extends Controller
{ {
$finalData = []; $finalData = [];
$data = HierarchyFtth::where('project_id', $project_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); $data = HierarchyFtth::where('project_id', $project_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get();
foreach($data as $objRow){ foreach($data as $objRow){
if (VersionGantt::where('hierarchy_ftth_id', $objRow->id)->exists()) {
$dataGantt = VersionGantt::where('hierarchy_ftth_id', $objRow->id)->get();
$objRow->dataGantt = $dataGantt;
}
$objRow->key = rand(1, 1000); $objRow->key = rand(1, 1000);
$objRow->children = $this->getChildren($project_id, $objRow->id); $objRow->children = $this->getChildren($project_id, $objRow->id);
$finalData[] = $objRow; $finalData[] = $objRow;

Loading…
Cancel
Save