mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 00:04:24 +00:00
Code cleanup
This commit is contained in:
@@ -39,16 +39,19 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
// orderBy('date', 'DESC')->toRawSql();
|
||||
return
|
||||
$this->userGroup->currencyExchangeRates()
|
||||
->where(function (Builder $q1) use ($from, $to) {
|
||||
$q1->where(function (Builder $q) use ($from, $to) {
|
||||
$q->where('from_currency_id', $from->id)
|
||||
->where('to_currency_id', $to->id);
|
||||
})->orWhere(function (Builder $q) use ($from, $to) {
|
||||
$q->where('from_currency_id', $to->id)
|
||||
->where('to_currency_id', $from->id);
|
||||
});
|
||||
})
|
||||
->orderBy('date', 'DESC')->get(['currency_exchange_rates.*']);
|
||||
->where(function (Builder $q1) use ($from, $to): void {
|
||||
$q1->where(function (Builder $q) use ($from, $to): void {
|
||||
$q->where('from_currency_id', $from->id)
|
||||
->where('to_currency_id', $to->id)
|
||||
;
|
||||
})->orWhere(function (Builder $q) use ($from, $to): void {
|
||||
$q->where('from_currency_id', $to->id)
|
||||
->where('to_currency_id', $from->id)
|
||||
;
|
||||
});
|
||||
})
|
||||
->orderBy('date', 'DESC')->get(['currency_exchange_rates.*'])
|
||||
;
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user