message = $messageModel; } public function getUser($token) { $user = $this->getCache($token); if(!$user){ $this->throwError('登陆信息失效,请重新进行登陆','0099'); } return $user; } public function getMessageList($params,$id) { $info = $this->message->getMessageList($params,$id); return $info; } public function readMessage($id,$user) { $info = $this->message->readMessage($id); if($info){ $this->delCache($user['id'].'_unread'); } return $info; } public function unReadMessage($id) { if($this->getCache($id.'_unread')) { $info = $this->getCache($id.'_unread'); return $info; }else{ $info = $this->message->unReadMessage($id); $this->setCache($id.'_unread',$info,3600); return $info; }; } public function getAppUnread($id) { $info = $this->message->getAppUnread($id); return $info; } public function delReadMessage($id) { $info = $this->message->delReadMessage($id); return $info; } public function delAllMessage($id,$user) { $info = $this->message->delAllMessage($id); if($info){ $this->delCache($user['id'].'_unread'); } return $info; } public function read($id,$user) { $info = $this->message->read($id); if($info){ $this->delCache($user['id'].'_unread'); } return $info; } public function getInfo($id,$user) { $info = $this->message->getInfo($id); if($info){ $this->delCache($user['id'].'_unread'); } return $info; } public function deleteone($id,$user) { $info = $this->message->deleteone($id); if($info){ $this->delCache($user['id'].'_unread'); } return $info; } public function getSpecialMessage($institution) { $info = $this->message->getSpecialMessage($institution); return $info; } }