diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index b21531e..3bb372a 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -273,17 +273,22 @@ class HomeController extends Controller $r = Address::select([ 'a.id', - 'system_id', - 'zone_id', - 'host_id', - 'node_id', + 'addresses.system_id', + 'addresses.zone_id', + 'addresses.host_id', + 'addresses.node_id', DB::raw('sum(a.e) as e'), DB::raw('sum(a.n) as n'), DB::raw('sum(a.f) as f') ]) ->from($e->union($n)->union($f),'a') + ->where('addresses.active',TRUE) + ->where('zones.active',TRUE) + ->where('domains.active',TRUE) ->join('addresses',['addresses.id'=>'a.id']) - ->groupBy('system_id','a.id','zone_id','host_id','node_id') + ->join('zones',['zones.id'=>'addresses.zone_id']) + ->join('domains',['domains.id'=>'zones.domain_id']) + ->groupBy('addresses.system_id','a.id','addresses.zone_id','addresses.host_id','addresses.node_id') ->with(['system','zone.domain']); return view('status')