model = new noticeModel(); } public function list() { $list = $this->model->where('status', 1)->paginate(10); foreach ($list as &$row) { $row['image'] = $this->request->domain().$row['image']; } $this->success('公告列表', $list); } public function detail() { $id = $this->request->param('id'); if (empty($id)) { $this->error('参数异常'); } $detail = $this->model ->where('status', 1) ->where('id', $id) ->find(); $detail['image'] = $this->request->domain().$detail['image']; $this->success('success', $detail); } }