Auto commit for release 'branch-v6.2' on 2024-12-22

This commit is contained in:
github-actions
2024-12-22 07:05:15 +01:00
parent 303548a5fe
commit a500de8ab1
67 changed files with 256 additions and 220 deletions

View File

@@ -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()
;
}
}

View File

@@ -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;
}