Compare commits

..

2 Commits

Author SHA1 Message Date
e1ed446f3e Ensure children() returns addresses in FTN order
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m36s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2024-12-01 16:31:07 +11:00
445dd48c81 When re-enabling dynamic items, ensure the next_at date is from today, not from when it was last run 2024-12-01 16:15:07 +11:00
2 changed files with 13 additions and 5 deletions

View File

@ -74,18 +74,27 @@ final class Dynamic extends Send
$this->do->next_at = $next_at
->addDay();
while ($this->do->next_at->isPast())
$this->do->next_at->addDay();
break;
case 'WEEKLY':
$this->do->next_at = $next_at
->addWeek();
while ($this->do->next_at->isPast())
$this->do->next_at->addWeek();
break;
case 'MONTHLY':
$this->do->next_at = $next_at
->addMonth();
while ($this->do->next_at->isPast())
$this->do->next_at->addMonth();
break;
default:

View File

@ -427,17 +427,13 @@ class Address extends Model
->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
->orderBy('domains.name')
->orderBy('region_id')
->orderBy('host_id')
->orderBy('node_id')
->orderBy('point_id')
->FTNorder()
->with([
'zone:zones.id,domain_id,zone_id,active',
'zone.domain:domains.id,name,active,public',
]);
}
/** @deprecated use FTN() */
public function scopeFTNOrder($query)
{
return $query
@ -971,6 +967,7 @@ class Address extends Model
->where('host_id',$this->host_id)
->where('hub_id',$this->id)
->where('id','<>',$this->id)
->FTNorder()
->get();
// Need to add in points of this hub's nodes
@ -981,6 +978,7 @@ class Address extends Model
->where('host_id',$this->host_id)
->whereIn('node_id',$o->pluck('node_id'))
->where('point_id','<>',0)
->FTNorder()
->get()
);
@ -1011,6 +1009,7 @@ class Address extends Model
return $o
->where('id','<>',$this->id)
->FTNorder()
->get();
}