Query optimisations using with()

This commit is contained in:
Deon George
2020-02-10 22:07:46 +11:00
parent cd18b98859
commit f41fc3eb9c
8 changed files with 101 additions and 33 deletions

View File

@@ -8,7 +8,6 @@ class Invoice extends Model
{
protected $table = 'ab_invoice';
protected $dates = ['date_orig','due_date'];
protected $with = ['account.country.currency','items.taxes','paymentitems'];
protected $appends = [
'date_due',
@@ -25,6 +24,12 @@ class Invoice extends Model
'total',
];
protected $with = [
'account.country.currency',
'items.taxes',
'paymentitems'
];
private $_total = 0;
private $_total_tax = 0;