mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve eager loading
This commit is contained in:
parent
aeeaa62d5e
commit
4b00d3a82a
@ -71,6 +71,7 @@ class BaseController extends Controller
|
|||||||
'company.clients.gateway_tokens',
|
'company.clients.gateway_tokens',
|
||||||
'company.clients.documents',
|
'company.clients.documents',
|
||||||
'company.products',
|
'company.products',
|
||||||
|
'company.products.documents',
|
||||||
'company.recurring_invoices',
|
'company.recurring_invoices',
|
||||||
'company.invoices.invitations.contact',
|
'company.invoices.invitations.contact',
|
||||||
'company.invoices.invitations.company',
|
'company.invoices.invitations.company',
|
||||||
@ -92,6 +93,7 @@ class BaseController extends Controller
|
|||||||
'company.tasks',
|
'company.tasks',
|
||||||
'company.projects',
|
'company.projects',
|
||||||
'company.designs',
|
'company.designs',
|
||||||
|
'company.documents',
|
||||||
'company.webhooks',
|
'company.webhooks',
|
||||||
'company.tokens_hashed',
|
'company.tokens_hashed',
|
||||||
];
|
];
|
||||||
@ -202,7 +204,7 @@ class BaseController extends Controller
|
|||||||
$query->with(
|
$query->with(
|
||||||
[
|
[
|
||||||
'company' => function ($query) use ($updated_at) {
|
'company' => function ($query) use ($updated_at) {
|
||||||
$query->whereNotNull('updated_at');
|
$query->whereNotNull('updated_at')->with('documents');
|
||||||
},
|
},
|
||||||
'company.clients' => function ($query) use ($updated_at) {
|
'company.clients' => function ($query) use ($updated_at) {
|
||||||
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts', 'gateway_tokens','documents');
|
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts', 'gateway_tokens','documents');
|
||||||
@ -217,7 +219,7 @@ class BaseController extends Controller
|
|||||||
$query->whereNotNull('updated_at');
|
$query->whereNotNull('updated_at');
|
||||||
},
|
},
|
||||||
'company.products' => function ($query) use ($updated_at) {
|
'company.products' => function ($query) use ($updated_at) {
|
||||||
$query->where('updated_at', '>=', $updated_at);
|
$query->where('updated_at', '>=', $updated_at)->with('documents');
|
||||||
},
|
},
|
||||||
'company.recurring_invoices'=> function ($query) use ($updated_at) {
|
'company.recurring_invoices'=> function ($query) use ($updated_at) {
|
||||||
$query->where('updated_at', '>=', $updated_at)->with('company');
|
$query->where('updated_at', '>=', $updated_at)->with('company');
|
||||||
|
@ -56,7 +56,7 @@ class SendFailedEmails implements ShouldQueue
|
|||||||
|
|
||||||
private function processEmails()
|
private function processEmails()
|
||||||
{
|
{
|
||||||
\Log::error('processing emails');
|
//\Log::error('processing emails');
|
||||||
//info("process emails");
|
//info("process emails");
|
||||||
//@todo check that the quota is available for the job
|
//@todo check that the quota is available for the job
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user