On the status page, dont show inactive addresses, zones or domains

This commit is contained in:
Deon George 2023-11-24 22:26:31 +11:00
parent 4c91ed54c0
commit eab35d4c18

View File

@ -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')