with(['staff'])->order('id desc')->paginate(); $this->success('请求成功', $list); } //获取报告详情 public function getDetail() { $id = input('id'); $detail = WorkreportModel::where(['id' => $id])->with(['staff'])->find(); if (empty($detail)) { $this->error('报告不存在'); } //标记通知已读 Message::setRead(Message::WORKREPORT_TYPE, $id, $this->auth->id); $this->success('请求成功', $detail); } }