Detect when we dont have an address in a domain, and pick the first domain address even if we are not in the zone.
This commit is contained in:
@@ -195,7 +195,9 @@ class System extends Model
|
||||
public function match(Zone $o,int $type=(Address::NODE_NC|Address::NODE_HC|Address::NODE_ACTIVE|Address::NODE_PVT|Address::NODE_POINT)): Collection
|
||||
{
|
||||
return $this->akas
|
||||
->where('zone_id',$o->id)
|
||||
->where(function($item) use($o) {
|
||||
return ($item->zone_id === $o->id) || ($item->zone->domain_id === $o->domain_id);
|
||||
})
|
||||
->filter(function($item) use ($type) {
|
||||
return $item->role & $type;
|
||||
});
|
||||
|
Reference in New Issue
Block a user