model = $model; } use Curd; /** * @NodeAnotation(title="列表") */ public function index() { if ($this->request->isAjax()) { if (input('selectFields')) { return $this->selectList(); } list($page, $limit, $where) = $this->buildTableParames(); Cache::set("WITHDRAW_EXPORT", ['page' => $page, 'limit' => $limit, 'where' => $where]); list($count, $list) = WithdrawLogLogic::getList($page, $limit, $where, $this->user_map, $this->sort); $data = [ 'code' => 0, 'msg' => '', 'count' => $count, 'data' => $list, ]; return json($data); } $this->assign('limits',[10, 15, 20, 25, 50, 100]); return $this->fetch(); } /** * @NodeAnotation(title="提现失败") */ public function withdrawerror($id) { if ($this->request->isPost()) { $post = $this->request->post(); list($return, $msg) = WithdrawLogLogic::withdrawError($id, $post); $return === true ? $this->success($msg) : $this->error($msg); } return $this->fetch(); } /** * @NodeAnotation(title="执行提现") */ public function tx($id) { list($return, $msg) = WithdrawLogLogic::tx($id); $return === true ? $this->success($msg) : $this->error($msg); } /** * @NodeAnotation(title="导出") */ public function export() { list($page, $limit, $where) = $this->buildTableParames(); if (empty($where)) { $search = Cache::get("WITHDRAW_EXPORT"); $page = $search['page']; $limit = $search['limit']; $where = $search['where']; } $header = getExportHeader($this->model->getName(), $this->noExportFields); $list = WithdrawLogLogic::getExportList($where, $page, $limit); $fileName = time(); return Excel::exportData($list, $header, $fileName, 'xlsx'); } /** * @NodeAnotation(title="提现数据") */ public function withdrawdata() { $tx_success = WithdrawLog::SumPracticalMoneyByStatus(1); $this->assign('tx_success', $tx_success); $tx = WithdrawLog::SumPracticalMoneyByStatus(0); $this->assign('tx', $tx); return $this->fetch(); } /** * 退还手续费 * @return mixed */ public function returnservicemoney() { $id = $this->request['id']; $withdrawLog = new WithdrawLogLogic(); if ($this->request->isPost()) { $post = $this->request->post(); try { validate(ReturnServiceMoney::class)->check($post); } catch (ValidateException $e) { $this->error($e->getMessage()); } $result = $withdrawLog->returnServiceMoney($post); if ($result !== true) { $this->error($result); } $this->success('成功'); } $withdrawLog->getWithdrawLog($id); $this->assign('info', $withdrawLog); return $this->fetch(); } }