model = $model; } /** * 提现列表 * @return mixed|\think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function index () { if ($this->request->isAjax()) { if (input('selectFields')) { return $this->selectList(); } list($page, $limit, $where) = $this->buildTableParames(); foreach ($where as $key=>$val){ if ($val[0] == 'status'){ $where[$key][0] = 'o.status'; } if ($val[0] == 'create_at'){ $where[$key][0] = 'create_at'; $where[$key][2] = sr_getcurtime($where[$key][2]); } } $count = $this->model ->where('type', 'in',[6]) ->withJoin('user', 'INNER') ->where($this->user_map) ->where($where) ->count(); $list = $this->model ->where('type', 'in',[6]) ->withJoin('user', 'INNER') ->where($this->user_map) ->where($where) ->page($page, $limit) ->order($this->sort) ->select(); foreach ($list as $key=>$val){ $list[$key]['mobile2'] = Db::name('user')->where('id', $val['uid2'])->value('mobile'); } $data = [ 'code' => 0, 'msg' => '', 'count' => $count, 'data' => $list, ]; return json($data); } return $this->fetch(); } }