User optimisation and code cleanup

This commit is contained in:
2024-07-05 22:56:02 +10:00
parent b6b036e06d
commit 326b1dcfc5
12 changed files with 80 additions and 294 deletions

View File

@@ -317,6 +317,18 @@ class Service extends Model implements IDs
return sprintf('%02s-%04s.%s',$this->site_id,$this->account_id,$this->getLIDattribute());
}
/* STATIC */
public static function movements(User $uo): Collection
{
return (new self)
->active()
->serviceUserAuthorised($uo)
->where('order_status','!=','ACTIVE')
->with(['account','product'])
->get();
}
/* RELATIONS */
/**