mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Auto commit for release 'branch-v6.2' on 2024-12-22
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* ExchangeRateRepository.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
@@ -32,20 +33,23 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
|
||||
#[\Override] public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||
#[\Override]
|
||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||
{
|
||||
return
|
||||
$this->userGroup->currencyExchangeRates()
|
||||
->where(function (Builder $q) use ($from, $to) {
|
||||
$q->where('from_currency_id', $from->id)
|
||||
->orWhere('to_currency_id', $to->id);
|
||||
})
|
||||
->orWhere(function (Builder $q) use ($from, $to) {
|
||||
$q->where('from_currency_id', $to->id)
|
||||
->orWhere('to_currency_id', $from->id);
|
||||
})
|
||||
->orderBy('date', 'DESC')->get();
|
||||
->where(function (Builder $q) use ($from, $to): void {
|
||||
$q->where('from_currency_id', $from->id)
|
||||
->orWhere('to_currency_id', $to->id)
|
||||
;
|
||||
})
|
||||
->orWhere(function (Builder $q) use ($from, $to): void {
|
||||
$q->where('from_currency_id', $to->id)
|
||||
->orWhere('to_currency_id', $from->id)
|
||||
;
|
||||
})
|
||||
->orderBy('date', 'DESC')->get()
|
||||
;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* ExchangeRateRepositoryInterface.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
@@ -28,7 +29,5 @@ use Illuminate\Support\Collection;
|
||||
|
||||
interface ExchangeRateRepositoryInterface
|
||||
{
|
||||
|
||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user