mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 09:34:05 +00:00
Improve query formatting
This commit is contained in:
parent
3a6e673418
commit
9414b17f06
3 changed files with 3 additions and 6 deletions
|
|
@ -41,8 +41,7 @@ class ClearPendingTenants extends Command
|
|||
$expirationDate->subHours($olderThanHours);
|
||||
}
|
||||
|
||||
$deletedTenantCount = tenancy()
|
||||
->query()
|
||||
$deletedTenantCount = tenancy()->query()
|
||||
->onlyPending()
|
||||
->when($originalExpirationDate->notEqualTo($expirationDate), function (Builder $query) use ($expirationDate) {
|
||||
$query->where($query->getModel()->getColumnForQuery('pending_since'), '<', $expirationDate->timestamp);
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ class CreatePendingTenants extends Command
|
|||
/** Calculate the number of currently available pending tenants. */
|
||||
protected function getPendingTenantCount(): int
|
||||
{
|
||||
return tenancy()
|
||||
->query()
|
||||
return tenancy()->query()
|
||||
->onlyPending()
|
||||
->count();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ trait HasTenantOptions
|
|||
|
||||
protected function getTenants(): LazyCollection
|
||||
{
|
||||
return tenancy()
|
||||
->query()
|
||||
return tenancy()->query()
|
||||
->when($this->option('tenants'), function ($query) {
|
||||
$query->whereIn(tenancy()->model()->getTenantKeyName(), $this->option('tenants'));
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue