From 4f1f360346e0acec8bdca94e49b4666bf92fe90d Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 7 Aug 2025 05:55:15 +0200 Subject: [PATCH] Add primary to array. --- app/Support/Steam.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 289fe9ecac..c375948636 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -755,10 +755,11 @@ class Steam private function getCurrencies(Collection $accounts): array { - $currencies = []; - $accountCurrencies = []; - $accountPreferences = []; - $primary = Amount::getPrimaryCurrency(); + $currencies = []; + $accountCurrencies = []; + $accountPreferences = []; + $primary = Amount::getPrimaryCurrency(); + $currencies[$primary->id] = $primary; $ids = $accounts->pluck('id')->toArray(); $result = AccountMeta::whereIn('account_id', $ids)->where('name', 'currency_id')->get(); @@ -770,8 +771,8 @@ class Steam $accountPreferences[(int)$item->account_id] = $integer; } } - // collect those currencies. - $set = TransactionCurrency::whereIn('id', $accountPreferences)->get(); + // collect those currencies, skip primary because we already have it. + $set = TransactionCurrency::whereIn('id', $accountPreferences)->where('id','!=',$primary->id)->get(); foreach ($set as $item) { $currencies[$item->id] = $item; }