Browse Source

Merge pull request 'dev-wahyun' (#188) from dev-wahyun into staging

Reviewed-on: ordo/adw-backend#188
pull/3/head
ibnu 1 year ago
parent
commit
575e2375e6
  1. 4
      app/Http/Controllers/DashboardBoDController.php
  2. 2
      app/Http/Controllers/DivisiController.php

4
app/Http/Controllers/DashboardBoDController.php

@ -271,7 +271,7 @@ class DashboardBoDController extends Controller
{ {
$year = $this->interpolateYear($year); $year = $this->interpolateYear($year);
$divisions = Divisi::select('id', 'name') $divisions = Divisi::select('id', 'name','parent')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->get(); ->get();
@ -358,4 +358,4 @@ class DashboardBoDController extends Controller
'total_manpowers' => User::count() 'total_manpowers' => User::count()
], 200); ], 200);
} }
} }

2
app/Http/Controllers/DivisiController.php

@ -92,7 +92,7 @@ class DivisiController extends Controller
public function list() public function list()
{ {
$parentMenus = Divisi::whereNull('parent')->with('children')->get(); $parentMenus = Divisi::with('children')->whereNull('parent')->get();
$divisions = []; $divisions = [];
foreach($parentMenus as $menu){ foreach($parentMenus as $menu){
$childs = $this->getAllChildren($menu); $childs = $this->getAllChildren($menu);

Loading…
Cancel
Save