From eab35d4c183fc32157f8ec35663ff1c9fa97c771 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 24 Nov 2023 22:26:31 +1100 Subject: [PATCH] On the status page, dont show inactive addresses, zones or domains --- app/Http/Controllers/HomeController.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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')