| // +------------------------------------------------+ namespace app\system\controller; use app\common\model\Withdrawal as WithdrawalModel; use app\common\service\Excel; use app\common\service\Withdrawal as WithdrawalService; class Withdrawal extends _Init { public function index($nickname = '') { $model = new WithdrawalModel(); $model = $model->hasWhere('userinfo'); $map = []; if ($nickname) { $map["MemberInfo.nickname"] = ['like', "%$nickname%"]; } $this->list = $model->where($map)->order('create_time desc')->paginate(); return $this->fetch(''); } /** * 修改提现状态 * @param [type] $id 提现id * @param [type] $status 状态 * @return [type] */ public function status($status, $id) { $result = WithdrawalService::status($id, $status); return $this->back($result); } public function toexcel($nickname = '') { $model = new WithdrawalModel(); $model = $model->hasWhere('userinfo'); $map = []; if ($nickname) { $map["MemberInfo.nickname"] = ['like', "%$nickname%"]; } $list = $model->where($map)->order('create_time desc')->select(); Excel::withdrawal_excel($list); } }