mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Improve eager loading
This commit is contained in:
parent
88eb05786e
commit
20e4c4b1ad
@ -69,11 +69,16 @@ class BaseController extends Controller
|
||||
'company.company_gateways.gateway',
|
||||
'company.clients.contacts',
|
||||
'company.clients.gateway_tokens',
|
||||
'company.clients.documents',
|
||||
'company.products',
|
||||
'company.recurring_invoices',
|
||||
'company.invoices.invitations.contact',
|
||||
'company.invoices.invitations.company',
|
||||
'company.invoices.documents',
|
||||
'company.recurring_invoices',
|
||||
'company.recurring_invoices.invitations.contact',
|
||||
'company.recurring_invoices.invitations.company',
|
||||
'company.recurring_invoices.documents',
|
||||
'company.payments.paymentables',
|
||||
'company.quotes.invitations.contact',
|
||||
'company.quotes.invitations.company',
|
||||
@ -200,7 +205,7 @@ class BaseController extends Controller
|
||||
$query->whereNotNull('updated_at');
|
||||
},
|
||||
'company.clients' => function ($query) use ($updated_at) {
|
||||
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts');
|
||||
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts', 'gateway_tokens','documents');
|
||||
},
|
||||
'company.tax_rates' => function ($query) use ($updated_at) {
|
||||
$query->where('updated_at', '>=', $updated_at);
|
||||
@ -220,8 +225,11 @@ class BaseController extends Controller
|
||||
'company.invoices'=> function ($query) use ($updated_at) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'company', 'documents');
|
||||
},
|
||||
'company.recurring_invoices'=> function ($query) use ($updated_at) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'company', 'documents');
|
||||
},
|
||||
'company.payments'=> function ($query) use ($updated_at) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('paymentables');
|
||||
$query->where('updated_at', '>=', $updated_at)->with('paymentables','documents');
|
||||
},
|
||||
'company.quotes'=> function ($query) use ($updated_at) {
|
||||
$query->where('updated_at', '>=', $updated_at)->with('invitations', 'documents');
|
||||
|
@ -52,8 +52,8 @@ class QueryLogging
|
||||
|
||||
Log::info($request->method().' - '.$request->url().": $count queries - ".$time);
|
||||
|
||||
// if($count > 100)
|
||||
// Log::info($queries);
|
||||
if($count > 50)
|
||||
Log::info($queries);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ class EntityPaidObject
|
||||
'button' => ctrans('texts.view_payment'),
|
||||
'signature' => $settings->email_signature,
|
||||
'logo' => $this->company->present()->logo(),
|
||||
'setting' => $settings,
|
||||
'settings' => $settings,
|
||||
];
|
||||
|
||||
return $data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user