Merge pull request #6120 from turbo124/v5-develop

Tweaks for company size check
This commit is contained in:
David Bomba 2021-06-24 17:25:29 +10:00 committed by GitHub
commit 8939860af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,10 +55,15 @@ class CompanySizeCheck implements ShouldQueue
private function check()
{
Company::cursor()->each(function ($company) {
if ($company->invoices->count() > 1000 || $company->products->count() > 1000 || $company->clients->count() > 1000) {
if ($company->invoices()->count() > 1000 || $company->products()->count() > 1000 || $company->clients()->count() > 1000) {
nlog("Marking company {$company->id} as large");
$company->is_large = true;
$company->save();
}
});
}
}