Compare commits
3 Commits
a32e2e504a
...
e1bd2b7d06
Author | SHA1 | Date | |
---|---|---|---|
e1bd2b7d06 | |||
1837e69520 | |||
da098064bc |
@ -260,17 +260,18 @@ class Address extends Model
|
|||||||
$o->node_id = $ftn['f'];
|
$o->node_id = $ftn['f'];
|
||||||
$o->point_id = $ftn['p'];
|
$o->point_id = $ftn['p'];
|
||||||
|
|
||||||
$zo = Zone::where('zone_id',$ftn['z'])
|
if ($ftn['z'] === 0) {
|
||||||
->when($do,fn($query)=>$query->where('domain_id',$do->id))
|
|
||||||
->single();
|
|
||||||
|
|
||||||
$o->zone_id = $zo?->id;
|
|
||||||
|
|
||||||
if (($ftn['z'] === 0) || (! $zo)) {
|
|
||||||
Log::alert(sprintf('%s:! newFTN was parsed an FTN [%s] with a zero zone, adding empty zone in domain',self::LOGKEY,$address));
|
Log::alert(sprintf('%s:! newFTN was parsed an FTN [%s] with a zero zone, adding empty zone in domain',self::LOGKEY,$address));
|
||||||
|
|
||||||
$zo = new Zone;
|
$zo = new Zone;
|
||||||
$zo->domain_id = $do?->id;
|
$zo->domain_id = $do?->id;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$zo = Zone::where('zone_id',$ftn['z'])
|
||||||
|
->when($do,fn($query)=>$query->where('domain_id',$do->id))
|
||||||
|
->single();
|
||||||
|
|
||||||
|
$o->zone_id = $zo?->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$o->zone()->associate($zo);
|
$o->zone()->associate($zo);
|
||||||
|
Loading…
Reference in New Issue
Block a user