Fix packet processing issue - we now find recent deleted address when creatingFTN, fix netmail processing with points, fix processing badly address netmails
This commit is contained in:
@@ -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();
|
||||
})
|
||||
|
Reference in New Issue
Block a user