|
|
@@ -841,14 +841,16 @@ class ConfigController extends BaseController {
|
|
|
|
|
|
$currencies = array_filter($currencies, fn($item) => in_array($item['ID'], $countriesCurrencyIds));
|
|
|
$currencies = array_values($currencies);
|
|
|
+ $currenciesMap = array_column($currencies, null, 'ID');
|
|
|
|
|
|
foreach ($countries as &$country) {
|
|
|
- $currency = $currencyConversion[$country['LOCAL_CURRENCY_ID']];
|
|
|
+ $currency = $currenciesMap[$country['LOCAL_CURRENCY_ID']];
|
|
|
+ $conversion = $currencyConversion[$country['LOCAL_CURRENCY_ID']];
|
|
|
|
|
|
$country['currency'] = $currency['NAME'];
|
|
|
$country['currencyCode'] = $currency['CODE'];
|
|
|
- $country['productRate'] = $currencyConversion[$currency['ID']]['PRODUCT_RATE'] ?? 0;
|
|
|
- $country['bonusesRate'] = $currencyConversion[$currency['ID']]['BONUSES_RATE'] ?? 0;
|
|
|
+ $country['productRate'] = $conversion[$currency['ID']]['PRODUCT_RATE'] ?? 0;
|
|
|
+ $country['bonusesRate'] = $conversion[$currency['ID']]['BONUSES_RATE'] ?? 0;
|
|
|
}
|
|
|
|
|
|
// foreach ($currencies as &$currency) {
|