|
|
@@ -155,24 +155,24 @@ class UserController extends BaseController
|
|
|
if ($user['merchantId'] != $this->merchantId) {
|
|
|
util::fail('您没有权限操作');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$confirmPassword = $post['confirmPassword'];
|
|
|
AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
|
|
|
-
|
|
|
+
|
|
|
$grade = xhMerchantExtendService::getGradeList($this->merchantExtend, 'desc');
|
|
|
$newLevelGrowth = $grade[$memberLevel]['growth'];//升级到当前级别需要的积分数
|
|
|
$userAsset = UserAssetService::getByUserId($userId);//用户资产
|
|
|
if (!empty($userAsset['isMember']) && $userAsset['memberLevel'] >= $memberLevel) {
|
|
|
util::fail('客户已经达到此级别了');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$now = time();
|
|
|
$date = date("Y-m-d H:i", $now);
|
|
|
-
|
|
|
+
|
|
|
$connection = Yii::$app->db;//事务处理
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
- Yii::info(json_encode($userAsset));
|
|
|
+
|
|
|
$addGrowth = $newLevelGrowth - $userAsset['growth'];
|
|
|
//升级后的成长值
|
|
|
$upData['growth'] = $newLevelGrowth;
|