repository = $repository; } /** * @return \think\response\Json * @author zfy * @day 2020/11/6 */ public function lst() { [$page, $limit] = $this->getPage(); $where = $this->request->params(['is_read', 'date', 'keyword']); $where['mer_id'] = $this->request->merId(); return app('json')->success($this->repository->getList($where, $page, $limit)); } /** * @param $id * @author zfy * @day 2020/11/6 */ public function read($id) { $this->repository->read(intval($id), $this->request->merId()); return app('json')->success(); } public function del($id) { $this->repository->del(intval($id), $this->request->merId()); return app('json')->success(); } public function unreadCount() { return app('json')->success(['count' => $this->repository->unreadCount($this->request->merId())]); } }