mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Removed boolean for left join that was never called more than twice anyway.
This commit is contained in:
parent
b0cc6dd714
commit
bf4a7846dd
@ -40,9 +40,6 @@ class TransactionJournal extends Model
|
|||||||
'encrypted' => 'required|boolean',
|
'encrypted' => 'required|boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $joinedTransactionTypes;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
@ -307,12 +304,9 @@ class TransactionJournal extends Model
|
|||||||
*/
|
*/
|
||||||
public function scopeTransactionTypes(EloquentBuilder $query, array $types)
|
public function scopeTransactionTypes(EloquentBuilder $query, array $types)
|
||||||
{
|
{
|
||||||
if (is_null($this->joinedTransactionTypes)) {
|
$query->leftJoin(
|
||||||
$query->leftJoin(
|
'transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'
|
||||||
'transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'
|
);
|
||||||
);
|
|
||||||
$this->joinedTransactionTypes = true;
|
|
||||||
}
|
|
||||||
$query->whereIn('transaction_types.type', $types);
|
$query->whereIn('transaction_types.type', $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user