|
|
@@ -184,16 +184,17 @@ class ShopController extends BaseController {
|
|
|
$adminId = Yii::$app->getUser()->getUserInfo()['id'];
|
|
|
$adminCountry = AdminCountry::getCountry($adminId);
|
|
|
|
|
|
- foreach ($countries as &$country) {
|
|
|
+ foreach ($countries as $key => $country) {
|
|
|
if (!in_array($country, $adminCountry)) {
|
|
|
+ unset($countries[$key]);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 货币
|
|
|
- $country['LOCAL_CURRENCY_NAME'] = $currencies[$country['LOCAL_CURRENCY_ID']]['NAME'] ?? '';
|
|
|
- $country['CURRENCY_PRODUCT_RATE'] = $currenciesConversions[$country['LOCAL_CURRENCY_ID']]['PRODUCT_RATE'] ?? 0;
|
|
|
+ $countries[$key]['LOCAL_CURRENCY_NAME'] = $currencies[$country['LOCAL_CURRENCY_ID']]['NAME'] ?? '';
|
|
|
+ $countries[$key]['CURRENCY_PRODUCT_RATE'] = $currenciesConversions[$country['LOCAL_CURRENCY_ID']]['PRODUCT_RATE'] ?? 0;
|
|
|
// 商品属性
|
|
|
- $country['SHOP_GOODS_NATURE'] = ShopGoodsNature::findAllAsArray('GOODS_ID=:GOODS_ID AND COUNTRY_ID=:COUNTRY_ID', [':GOODS_ID' => $id, ':COUNTRY_ID' => $country['ID']]);
|
|
|
+ $countries[$key]['SHOP_GOODS_NATURE'] = ShopGoodsNature::findAllAsArray('GOODS_ID=:GOODS_ID AND COUNTRY_ID=:COUNTRY_ID', [':GOODS_ID' => $id, ':COUNTRY_ID' => $country['ID']]);
|
|
|
}
|
|
|
|
|
|
$data['SHOP_GOODS_NATURE'] = $countries;
|