作者 刘朕
1 个管道 的构建 通过 耗费 1 秒

合并分支 'Branch_liuzhen' 到 'master'

提现优化



查看合并请求 !261
@@ -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]);