...
|
...
|
@@ -1507,8 +1507,6 @@ class Store extends Api |
|
|
'money' => $param['money'],
|
|
|
];
|
|
|
$result = $withdraw_model->isUpdate(false)->save($withdraw);
|
|
|
// 记录用户余额
|
|
|
$result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'score' => $user['score'] - $param['money'] * $withdraw_percent]);
|
|
|
// 记录余额变更
|
|
|
$insert_data = array(
|
|
|
'user_id' => $this->auth->id,
|
...
|
...
|
@@ -1520,6 +1518,8 @@ class Store extends Api |
|
|
'memo' => '提现',
|
|
|
);
|
|
|
$res_log = Db::name('user_score_log')->insert($insert_data);
|
|
|
// 记录用户余额
|
|
|
$result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'score' => $user['score'] - $param['money'] * $withdraw_percent]);
|
|
|
if (!$result || !$result_user || !$res_log) {
|
|
|
Db::rollback();
|
|
|
$this->error('提现申请失败', [$result, $result_user]);
|
...
|
...
|
|