Update NodesNew report
This commit is contained in:
parent
ec139b79a2
commit
f4ee2e1a51
@ -204,7 +204,8 @@ class AddressIdle implements ShouldQueue
|
|||||||
->where(fn($query)=>$query->where('point_id',0)->orWhereNull('point_id'))
|
->where(fn($query)=>$query->where('point_id',0)->orWhereNull('point_id'))
|
||||||
->whereIn('addresses.id',our_nodes($do)->pluck('id'))
|
->whereIn('addresses.id',our_nodes($do)->pluck('id'))
|
||||||
->when($ao,fn($query)=>$query->where('addresses.id',$ao->id))
|
->when($ao,fn($query)=>$query->where('addresses.id',$ao->id))
|
||||||
->where(fn($q)=>$q->where('last_session','<',$age)->orWhereNull('last_session'))
|
->where(fn($q)=>$q->where('last_session','<',$age)
|
||||||
|
->orWhere(fn($q)=>$q->whereNull('last_session')->where('updated_at','<',Carbon::now()->subDays(14)->startOfDay())))
|
||||||
->whereRaw(sprintf('((role IS NULL) OR (role=0) OR ((role & %d) > 0))',$flags))
|
->whereRaw(sprintf('((role IS NULL) OR (role=0) OR ((role & %d) > 0))',$flags))
|
||||||
->whereRaw(sprintf('((role IS NULL) OR ((role & %d) = 0))',Address::NODE_KEEP))
|
->whereRaw(sprintf('((role IS NULL) OR ((role & %d) = 0))',Address::NODE_KEEP))
|
||||||
->join('systems',['systems.id'=>'addresses.system_id'])
|
->join('systems',['systems.id'=>'addresses.system_id'])
|
||||||
|
@ -11,7 +11,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
|
||||||
use App\Models\{Address, Domain, System};
|
use App\Models\{Address,Domain};
|
||||||
use App\Notifications\Netmails\NodesNew as NotificationNodesNew;
|
use App\Notifications\Netmails\NodesNew as NotificationNodesNew;
|
||||||
|
|
||||||
class NodesNew implements ShouldQueue
|
class NodesNew implements ShouldQueue
|
||||||
@ -43,11 +43,13 @@ class NodesNew implements ShouldQueue
|
|||||||
|
|
||||||
$result = Address::FTN()
|
$result = Address::FTN()
|
||||||
->ActiveFTN()
|
->ActiveFTN()
|
||||||
|
->addSelect('addresses.created_at')
|
||||||
->join('systems',['systems.id'=>'addresses.system_id'])
|
->join('systems',['systems.id'=>'addresses.system_id'])
|
||||||
->join('system_zone',['system_zone.system_id'=>'systems.id','system_zone.zone_id'=>'zones.id'])
|
->join('system_zone',['system_zone.system_id'=>'systems.id','system_zone.zone_id'=>'zones.id'])
|
||||||
->whereIn('zones.id',$this->do->zones->pluck('id'))
|
->whereIn('zones.id',$this->do->zones->pluck('id'))
|
||||||
->where('systems.active',TRUE)
|
->where('systems.active',TRUE)
|
||||||
->where('systems.created_at','>=',$since)
|
->where('systems.created_at','>=',$since)
|
||||||
|
->orderBy('addresses.created_at')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
if ($result->count()) {
|
if ($result->count()) {
|
||||||
|
@ -60,7 +60,8 @@ class NodesNew extends Netmails //implements ShouldQueue
|
|||||||
if ($c++)
|
if ($c++)
|
||||||
$msg->addText("\r");
|
$msg->addText("\r");
|
||||||
|
|
||||||
$msg->addText(sprintf("* %s - %s from %s.\r",$oo->ftn4D,$oo->system->sysop,$oo->system->location));
|
$msg->addText(sprintf("* %s - %s (%s) from %s.\r",$oo->ftn4D,$oo->system->sysop,$oo->system->name,$oo->system->location));
|
||||||
|
$msg->addText(sprintf("%s Address registered: %s\r\r",$space,$oo->created_at->format('Y-m-d')));
|
||||||
|
|
||||||
if ($oo->system->method) {
|
if ($oo->system->method) {
|
||||||
switch ($oo->system->method) {
|
switch ($oo->system->method) {
|
||||||
|
Loading…
Reference in New Issue
Block a user