From 41c748dca4a72f76c78f7b1be279474c7c6e3b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 17 Mar 2021 15:24:58 +0800 Subject: [PATCH] Update Rebate.php --- app/data/controller/api/auth/Rebate.php | 51 ------------------------- 1 file changed, 51 deletions(-) diff --git a/app/data/controller/api/auth/Rebate.php b/app/data/controller/api/auth/Rebate.php index 26e8aa6dd..198ee6c72 100644 --- a/app/data/controller/api/auth/Rebate.php +++ b/app/data/controller/api/auth/Rebate.php @@ -30,55 +30,4 @@ class Rebate extends Auth $query = $this->_query($this->table)->where(['uid' => $this->uuid]); $query->like('create_at#date')->order('id desc')->page(true, false, false, 15); } - - /** - * 提交用户提现审核 - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function addUsed() - { - if (!empty($this->user['status'])) { - $this->error('账户异常,请联系客服'); - } - $data = $this->_vali([ - 'amount.require' => '提现金额不能为空', - 'remark.default' => '用户主动提交审核', - ]); - $params = sysdata('TransferRule') ?: []; - if (empty($params['transfer_state'])) $this->error('提现功能已经关闭'); - [$total, $count] = UserRebateService::instance()->amount($this->uuid); - if ($total - $count - $data['amount'] < 0) $this->error('可提现金额不足'); - if ($data['amount'] < $params['transfer_min']) $this->error("提现不能少于{$params['transfer_min']}元"); - if ($data['amount'] > $params['transfer_max']) $this->error("提现不能大于{$params['transfer_max']}元"); - $result = $this->app->db->name('DataUserTransfer')->insert([ - 'uid' => $this->uuid, - 'code' => CodeExtend::uniqidDate(20, 'T'), - 'openid' => $this->user['openid1'], - 'status' => $params['transfer_audit'] > 0 ? 1 : 3, - 'amount' => $data['amount'], - 'remark' => $data['remark'], - ]); - if ($result !== false) { - UserRebateService::instance()->amount($this->uuid); - $this->success('提交申请成功'); - } else { - $this->error('提交申请失败'); - } - } - - /** - * 获取用户提现记录 - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function getUsed() - { - $date = input('date', date('Y-m-')); - $map = [['mid', '=', $this->mid], ['create_at', 'like', "{$date}%"]]; - $query = $this->_query('DataUserTransfer')->in('status')->order('id desc'); - $this->success('获取提现记录', $query->where($map)->page(true, false, false, 15)); - } } \ No newline at end of file