|
|
@@ -329,10 +329,12 @@ class ApproachDeclarationUpgradeForm extends Model
|
|
|
}
|
|
|
|
|
|
// 升级会员
|
|
|
- $userCountry = User::getEnCodeInfo($this->_insertUserId);
|
|
|
+ $userCountryId = User::getEnCodeInfo($this->_insertUserId)['COUNTRY_ID'];
|
|
|
+ $userCountry = Countries::getById($userCountryId);
|
|
|
$userCurrencyRate = CurrencyConversions::getToUSDRate($userCountry['LOCAL_CURRENCY_ID']);
|
|
|
// 报单中心汇率
|
|
|
- $decCountry = User::getEnCodeInfo(\Yii::$app->user->id)['COUNTRY_ID'];
|
|
|
+ $decCountryId = User::getEnCodeInfo(\Yii::$app->user->id)['COUNTRY_ID'];
|
|
|
+ $decCountry = Countries::getById($decCountryId);
|
|
|
$decUserCurrencyRate = CurrencyConversions::getToUSDRate($decCountry['LOCAL_CURRENCY_ID']);
|
|
|
|
|
|
$orderModel = new ApproachOrder();
|
|
|
@@ -366,7 +368,7 @@ class ApproachDeclarationUpgradeForm extends Model
|
|
|
$orderModel->PAY_AMOUNT_STANDARD = $this->_standardAmount;
|
|
|
$orderModel->EXCHANGE_RATE = $userCurrencyRate;
|
|
|
$orderModel->DEC_USER_ID = Info::getUserNameByUserId(\Yii::$app->user->id);
|
|
|
- $orderModel->COUNTRY_ID = $userCountry['COUNTRY_ID'];
|
|
|
+ $orderModel->COUNTRY_ID = $userCountryId;
|
|
|
$orderModel->CURRENCY_ID = $userCountry['LOCAL_CURRENCY_ID'] ?? 0;
|
|
|
if(!$orderModel->save()){
|
|
|
$transaction->rollBack();
|