mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
🤖 Auto commit for release 'develop' on 2025-08-15
This commit is contained in:
@@ -55,17 +55,20 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
||||
// orderBy('date', 'DESC')->toRawSql();
|
||||
return
|
||||
$this->userGroup->currencyExchangeRates()
|
||||
->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.*']);
|
||||
->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.*'])
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
@@ -75,10 +78,11 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
||||
/** @var null|CurrencyExchangeRate */
|
||||
return
|
||||
$this->userGroup->currencyExchangeRates()
|
||||
->where('from_currency_id', $from->id)
|
||||
->where('to_currency_id', $to->id)
|
||||
->where('date', $date->format('Y-m-d'))
|
||||
->first();
|
||||
->where('from_currency_id', $from->id)
|
||||
->where('to_currency_id', $to->id)
|
||||
->where('date', $date->format('Y-m-d'))
|
||||
->first()
|
||||
;
|
||||
}
|
||||
|
||||
#[Override]
|
||||
@@ -112,8 +116,8 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
||||
public function deleteRates(TransactionCurrency $from, TransactionCurrency $to): void
|
||||
{
|
||||
$this->userGroup->currencyExchangeRates()
|
||||
->where('from_currency_id', $from->id)
|
||||
->where('to_currency_id', $to->id)
|
||||
->delete();
|
||||
->where('from_currency_id', $from->id)
|
||||
->where('to_currency_id', $to->id)
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user