request->isPost()) { $this->error('请求方式异常'); } $type = input('type/d',0); $page = input('page/d',1); $limit = 10; $list = model('app\api\model\service\Notice')->where(['type'=>$type,'state'=>1])->field('id,title,image,createtime')->order('weigh desc,id desc')->page($page)->limit($limit)->select(); $this->success('列表返回成功',$list); } public function detail() { if (!$this->request->isPost()) { $this->error('请求方式异常'); } $id = input('id/d',''); $info = model('app\api\model\service\Notice')->where(['id'=>$id,'state'=>1])->find(); !$info && $this->error('信息异常'); $info['content'] = htmlspecialchars_decode($info['content']); $this->success('信息返回成功',$info); } }