lan = $this->request->getLan(); } //列表 public function list(AnnouncementModel $announcementModel) { $typeId = $this->request->param('type_id', 1, 'intval'); $paginator = $announcementModel->where('type_id', $typeId) ->where('status', 1)->where('to_lang', $this->lan) ->field('id,to_lang,weigh,img_url,createtime,title as title,introduction,body') ->order('weigh desc, id desc') ->paginate($this->pageSize); $this->success('', $this->buildResp($paginator->total(), $paginator->currentPage(), $paginator->items())); } public function show(int $id) { $info = (new AnnouncementModel) ->where('id', $id) //->where('status', 1) ->where('to_lang', $this->lan) ->field('id,img_url,to_lang,createtime,title,introduction,body') ->find(); if(empty($info)){ $this->error('公告信息不存'); } $this->success('', $info); } }