|
|
@@ -7,6 +7,7 @@ use common\helpers\Cache;
|
|
|
use common\helpers\Date;
|
|
|
use common\helpers\Form;
|
|
|
use common\helpers\LoggerTool;
|
|
|
+use common\helpers\snowflake\PageSnowFake;
|
|
|
use common\helpers\Tool;
|
|
|
use common\libs\logging\operate\AdminOperate;
|
|
|
use common\models\Countries;
|
|
|
@@ -152,7 +153,6 @@ class UserBasicForm extends Model {
|
|
|
// 移民后汇率
|
|
|
$beforeCurrencyId = Countries::getCurrency($this->country);
|
|
|
$afterCurrencyRate = CurrencyConversions::getToUSDRate($beforeCurrencyId);
|
|
|
- LoggerTool::debug(json_encode(['modifyProfile', $beforeCountry, $this->country, $afterCurrencyRate]));
|
|
|
if (!$afterCurrencyRate) {
|
|
|
throw new Exception(Yii::t('app', 'currencyDoesNotExist'));
|
|
|
}
|
|
|
@@ -185,6 +185,7 @@ class UserBasicForm extends Model {
|
|
|
$userModel->LANGUAGE_ID = $this->language;
|
|
|
$userModel->COUNTRY_ID = $this->country;
|
|
|
if( !$userModel->save(false) ) {
|
|
|
+ $transaction->rollBack();
|
|
|
throw new Exception($userModel->getErrors());
|
|
|
}
|
|
|
|
|
|
@@ -200,6 +201,7 @@ class UserBasicForm extends Model {
|
|
|
|
|
|
// 移民记录
|
|
|
$model = new UserImmigrant();
|
|
|
+ $model->ID = PageSnowFake::instance()->generateId();
|
|
|
$model->user_id = $this->userId;
|
|
|
$model->before_country_id = $beforeCountry;
|
|
|
$model->after_country_id = $this->country;
|
|
|
@@ -227,7 +229,7 @@ class UserBasicForm extends Model {
|
|
|
]);
|
|
|
}catch (Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
- return null;
|
|
|
+ throw new Exception($userModel->getErrors());
|
|
|
}
|
|
|
return $userModel;
|
|
|
}
|