Prechádzať zdrojové kódy

feat: NG-15: 新会员注册时增加国家与语言选项.

zhangl 1 rok pred
rodič
commit
18865b1074

+ 4 - 1
frontendApi/modules/v1/controllers/UserController.php

@@ -17,6 +17,7 @@ use common\helpers\user\Info;
 use common\models\BaUser;
 use common\models\Config;
 use common\models\Countries;
+use common\models\Currency;
 use common\models\CurrencyConversions;
 use common\models\DeclarationLevel;
 use common\models\DeclarationPackage;
@@ -589,8 +590,9 @@ class UserController extends BaseController {
         // 只查询普通商品
         $allGoods = ShopGoods::find()
             ->alias('S')
-            ->select('S.*,N.MARKET_PRICE,N.SELL_PRICE,N.TAX_RATE,N.LOCAL_CURRENCY_ID,N.COUNTRY_ID')
+            ->select('S.*,N.MARKET_PRICE,N.SELL_PRICE,N.TAX_RATE,N.LOCAL_CURRENCY_ID,N.COUNTRY_ID,C.CODE')
             ->join('INNER JOIN', ShopGoodsNature::tableName() . ' AS N', 'N.GOODS_ID=S.ID')
+            ->join('INNER JOIN', Currency::tableName() . ' AS C', 'C.ID=N.LOCAL_CURRENCY_ID')
             ->where("STATUS=1 AND CATEGORY_TYPE=1 " . $query_condition, [':COUNTRY_ID' => $countryId])
             ->orderBy('SORT ASC')
             ->asArray()
@@ -626,6 +628,7 @@ class UserController extends BaseController {
         if ($userCash) {
             $userBalance['cash'] = $userCash['CASH'];
             $userBalance['localCash'] = Tool::convertAmount($userCash['CASH'], $decUserCurrencyRate, $currencyRate);
+            $userBalance['coin'] = $country['CODE'];
         }
         // 行政区划
         $region = Region::getByCountryId($countryId);