input('page'); if ($page && !ctype_digit($page)) { return $this->error('页码错误'); } $list = Notice::where('agent_id', $this->agent_id) ->select(['title', 'updated_at']) ->orderBy('id', 'DESC') ->simplePaginate(15); return $this->success($list); } public function show() { $id = request()->input('id'); if (!$id || !ctype_digit($id)) { return $this->error('无效的ID'); } $data = Notice::where('agent_id', $this->agent_id)->find($id); if (!$data) { return $this->error('公告不存在或已删除'); } return $this->success($data); } }