mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-15 09:53:36 -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',
|
||||
];
|
||||
|
||||
/** @var bool */
|
||||
private $joinedTransactionTypes;
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*
|
||||
@ -307,12 +304,9 @@ class TransactionJournal extends Model
|
||||
*/
|
||||
public function scopeTransactionTypes(EloquentBuilder $query, array $types)
|
||||
{
|
||||
if (is_null($this->joinedTransactionTypes)) {
|
||||
$query->leftJoin(
|
||||
'transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'
|
||||
);
|
||||
$this->joinedTransactionTypes = true;
|
||||
}
|
||||
$query->leftJoin(
|
||||
'transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id'
|
||||
);
|
||||
$query->whereIn('transaction_types.type', $types);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user