正在显示
1 个修改的文件
包含
5 行增加
和
4 行删除
@@ -354,14 +354,15 @@ class Rider extends Api | @@ -354,14 +354,15 @@ class Rider extends Api | ||
354 | $money = $this->request->post('money'); | 354 | $money = $this->request->post('money'); |
355 | $user = $this->auth->getUser(); | 355 | $user = $this->auth->getUser(); |
356 | if ($user['money'] < $money) $this->error('可提现金额不足'); | 356 | if ($user['money'] < $money) $this->error('可提现金额不足'); |
357 | - $user->setDec('money',$money); | ||
358 | $data = [ | 357 | $data = [ |
359 | 'user_id' => $this->auth->id, | 358 | 'user_id' => $this->auth->id, |
360 | 'money' => $money, | 359 | 'money' => $money, |
361 | - 'memo' => '提现', | ||
362 | - 'createtime' => time() | 360 | + 'before' => $user->money, |
361 | + 'after' => $user->money-$money, | ||
362 | + 'memo' => '提现' | ||
363 | ]; | 363 | ]; |
364 | - Db::name('user_money_log')->insert($data); | 364 | + UserMoneyLog::create($data); |
365 | + $user->setDec('money',$money); | ||
365 | $this->success('提现成功'); | 366 | $this->success('提现成功'); |
366 | } | 367 | } |
367 | 368 |
-
请 注册 或 登录 后发表评论