Consistency and SQL Query optimisations - focused around the UI
This commit is contained in:
@@ -114,6 +114,7 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
|
||||
|
||||
// We are requesting a list of addresses for a Domain, or a specific Address, and we have more than 1
|
||||
switch (get_class($o)) {
|
||||
// Looking for addresses in the same domain, and if fido.strict, addresses that have a higher role (ie: uplink)
|
||||
case Address::class:
|
||||
$filter = $so->system->akas
|
||||
->filter(fn($item)=>$item->zone->domain_id === $o->zone->domain_id)
|
||||
@@ -125,6 +126,7 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
|
||||
|
||||
return $filter->count() ? $filter->last()->unsetRelation('nodes_hub') : NULL;
|
||||
|
||||
// Addresses in this domain
|
||||
case Domain::class:
|
||||
return $so->system->akas
|
||||
->filter(fn($item)=>$item->zone->domain_id === $o->id)
|
||||
|
Reference in New Issue
Block a user