Some BINKP optimisation, implemented crypt, implemented receiving compressed transfers
This commit is contained in:
@@ -72,6 +72,16 @@ class Address extends Model
|
||||
->FTNorder();
|
||||
}
|
||||
|
||||
public function scopeTrashed($query)
|
||||
{
|
||||
return $query->select($this->getTable().'.*')
|
||||
->join('zones',['zones.id'=>'addresses.zone_id'])
|
||||
->join('domains',['domains.id'=>'zones.domain_id'])
|
||||
->orderBy('domains.name')
|
||||
->withTrashed()
|
||||
->FTNorder();
|
||||
}
|
||||
|
||||
public function scopeFTNOrder($query)
|
||||
{
|
||||
return $query
|
||||
@@ -371,13 +381,18 @@ class Address extends Model
|
||||
* @return Address|null
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function findFTN(string $address,bool $create=FALSE,System $so=NULL): ?self
|
||||
public static function findFTN(string $address,bool $create=FALSE,System $so=NULL,bool $trashed=FALSE): ?self
|
||||
{
|
||||
$ftn = self::parseFTN($address);
|
||||
|
||||
// Are we looking for a region address
|
||||
if (($ftn['f'] === 0) && $ftn['p'] === 0) {
|
||||
$o = (new self)->active()
|
||||
$o = (new self)
|
||||
->when($trashed,function($query) {
|
||||
$query->trashed();
|
||||
},function($query) {
|
||||
$query->active();
|
||||
})
|
||||
->where('zones.zone_id',$ftn['z'])
|
||||
->where(function($q) use ($ftn) {
|
||||
return $q
|
||||
@@ -400,7 +415,12 @@ class Address extends Model
|
||||
return $o;
|
||||
}
|
||||
|
||||
$o = (new self)->active()
|
||||
$o = (new self)
|
||||
->when($trashed,function($query) {
|
||||
$query->trashed();
|
||||
},function($query) {
|
||||
$query->active();
|
||||
})
|
||||
->where('zones.zone_id',$ftn['z'])
|
||||
->where(function($q) use ($ftn) {
|
||||
return $q->where(function($qq) use ($ftn) {
|
||||
|
Reference in New Issue
Block a user