Browse Source

钱包迁移,后台

lizhen_gitee 2 years ago
parent
commit
f879f4c98d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      application/admin/controller/user/User.php

+ 4 - 3
application/admin/controller/user/User.php

@@ -375,10 +375,11 @@ class User extends Backend
                 if (!empty($params['jewel_add'])) {//钻石充值
                     $userWhere['id'] = $row['id'];
                     $user = Db::name('user')->where($userWhere)->find();
-                    $userwallet = Db::name('user_wallet')->where('user_id',$row['id'])->lock(true)->find();
+                    $userwallet = Db::name('user_wallet')->where('user_id',$row['id'])->find();
                     $jewelRes = model('Wallet')->lockChangeAccountRemain($row['id'],$params['jewel_add'],'+',0,'钻石充值',17,'jewel');
-                    if (!$jewelRes['status']) {
-                        throw new Exception($jewelRes['msg']);
+                    if ($jewelRes['status'] == false) {
+                        Db::rollback();
+                        $this->error($jewelRes['msg']);
                     }
                     $params['jewel'] = bcadd($userwallet['jewel'],$params['jewel_add']);
                     //充值日志记录