Fix packet processing issue - we now find recent deleted address when creatingFTN, fix netmail processing with points, fix processing badly address netmails
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 35s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m52s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
2024-07-11 23:33:17 +10:00
parent e10ca8f18a
commit 62a9139d14
10 changed files with 110 additions and 25 deletions

View File

@@ -175,10 +175,11 @@ class Address extends Model
*
* @param string $address
* @param bool $trashed
* @param bool $recent
* @return Address|null
* @throws \Exception
*/
public static function findFTN(string $address,bool $trashed=FALSE): ?self
public static function findFTN(string $address,bool $trashed=FALSE,bool $recent=FALSE): ?self
{
$ftn = self::parseFTN($address);
$o = NULL;
@@ -187,8 +188,11 @@ class Address extends Model
->select('addresses.*')
->join('zones',['zones.id'=>'addresses.zone_id'])
->join('domains',['domains.id'=>'zones.domain_id'])
->when($trashed,function($query) {
$query->withTrashed();
->when($trashed,function($query) use ($recent) {
return $query->withTrashed()
->orderBy('updated_at','DESC')
->when($recent,fn($query)=>$query->where(fn($query)=>$query
->where('deleted_at','>=',Carbon::now()->subMonth())->orWhereNull('deleted_at')));
},function($query) {
$query->active();
})