|
|
@@ -143,17 +143,31 @@ class ShopController extends BaseController {
|
|
|
$allAddress[$key]['COUNTY_NAME'] = Region::getCnName($row['COUNTY']);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 账户币种
|
|
|
+ $country = Countries::getById($user['COUNTRY_ID']);
|
|
|
+ $coin = Currency::getById($country['LOCAL_CURRENCY_ID']);
|
|
|
+
|
|
|
+ $decCountryId = User::getEnCodeInfo(\Yii::$app->user->id)['COUNTRY_ID'];
|
|
|
+ $decCountry = Countries::getById($decCountryId);
|
|
|
+ $decUserCurrencyRate = CurrencyConversions::getToUSDRate($decCountry['LOCAL_CURRENCY_ID']);
|
|
|
+ $currencyRate = CurrencyConversions::getToUSDRate($country['LOCAL_CURRENCY_ID']);
|
|
|
+
|
|
|
$userBalance = [
|
|
|
'cash' => 0,
|
|
|
'prp' => 0,
|
|
|
+ 'localCash' => 0,
|
|
|
+ 'localRrp' => 0,
|
|
|
];
|
|
|
|
|
|
if ($userCashResult = UserWallet::findOneAsArray(['USER_ID' => $user['ID']])) {
|
|
|
$userBalance['cash'] = $userCashResult['CASH'];
|
|
|
+ $userBalance['localCash'] = Tool::convertAmount($userCashResult['CASH'], $decUserCurrencyRate, $currencyRate);
|
|
|
}
|
|
|
|
|
|
if ($userPerformance = UserPerformance::getAmounts($user['ID'])) {
|
|
|
$userBalance['prp'] = $userPerformance;
|
|
|
+ $userBalance['localCash'] = Tool::convertAmount($userPerformance, $decUserCurrencyRate, $currencyRate);
|
|
|
}
|
|
|
|
|
|
// 运费模板
|
|
|
@@ -165,10 +179,6 @@ class ShopController extends BaseController {
|
|
|
|
|
|
$isDec = User::getEnCodeInfo(\Yii::$app->user->id)['IS_DEC'];
|
|
|
|
|
|
- // 账户币种
|
|
|
- $country = Countries::getById($user['COUNTRY_ID']);
|
|
|
- $coin = Currency::getById($country['LOCAL_CURRENCY_ID']);
|
|
|
-
|
|
|
return static::notice(
|
|
|
[
|
|
|
'payList'=>$payList,
|