mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 21:16:47 +00:00
Clean up code.
This commit is contained in:
@@ -80,7 +80,7 @@ class PiggyBankTransformer extends AbstractTransformer
|
||||
$piggyBanks = $objects->pluck('id')->toArray();
|
||||
$accountInfo = Account::whereIn('id', $objects->pluck('account_id')->toArray())->get();
|
||||
$currencyPreferences = AccountMeta::where('name', '"currency_id"')->whereIn('account_id', $objects->pluck('account_id')->toArray())->get();
|
||||
$currencies = [];
|
||||
$currencies = [];
|
||||
/** @var Account $account */
|
||||
foreach ($accountInfo as $account) {
|
||||
$id = $account->id;
|
||||
@@ -92,7 +92,7 @@ class PiggyBankTransformer extends AbstractTransformer
|
||||
foreach ($currencyPreferences as $preference) {
|
||||
$currencyId = (int)$preference->data;
|
||||
$accountId = $preference->account_id;
|
||||
$currencies[$currencyId] ??= TransactionJournal::find($currencyId);
|
||||
$currencies[$currencyId] ??= TransactionJournal::find($currencyId);
|
||||
$this->currencies[$accountId] = $currencies[$currencyId];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user