request->isAjax) { $params = $this->request->get(); $service = new NoticeService(['mall_id' => $this->mall_id]); return $this->success('ok', $service->getPageList($params)); } return $this->render($this->action->id); } /** * 消息阅读 * * @return mixed */ public function actionRead() { $id = $this->request->get('id'); $service = new NoticeService(['mall_id' => $this->mall_id]); $service->readNotice($id); return $this->success('ok'); } /** * 未读消息 * * @return mixed */ public function actionUnreadCount() { $service = new NoticeService(['mall_id' => $this->mall_id]); $unread_count = $service->getUnReadCount(); return $this->success('ok', compact('unread_count')); } }