正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
@@ -1507,8 +1507,6 @@ class Store extends Api | @@ -1507,8 +1507,6 @@ class Store extends Api | ||
1507 | 'money' => $param['money'], | 1507 | 'money' => $param['money'], |
1508 | ]; | 1508 | ]; |
1509 | $result = $withdraw_model->isUpdate(false)->save($withdraw); | 1509 | $result = $withdraw_model->isUpdate(false)->save($withdraw); |
1510 | - // 记录用户余额 | ||
1511 | - $result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'score' => $user['score'] - $param['money'] * $withdraw_percent]); | ||
1512 | // 记录余额变更 | 1510 | // 记录余额变更 |
1513 | $insert_data = array( | 1511 | $insert_data = array( |
1514 | 'user_id' => $this->auth->id, | 1512 | 'user_id' => $this->auth->id, |
@@ -1520,6 +1518,8 @@ class Store extends Api | @@ -1520,6 +1518,8 @@ class Store extends Api | ||
1520 | 'memo' => '提现', | 1518 | 'memo' => '提现', |
1521 | ); | 1519 | ); |
1522 | $res_log = Db::name('user_score_log')->insert($insert_data); | 1520 | $res_log = Db::name('user_score_log')->insert($insert_data); |
1521 | + // 记录用户余额 | ||
1522 | + $result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'score' => $user['score'] - $param['money'] * $withdraw_percent]); | ||
1523 | if (!$result || !$result_user || !$res_log) { | 1523 | if (!$result || !$result_user || !$res_log) { |
1524 | Db::rollback(); | 1524 | Db::rollback(); |
1525 | $this->error('提现申请失败', [$result, $result_user]); | 1525 | $this->error('提现申请失败', [$result, $result_user]); |
-
请 注册 或 登录 后发表评论