|
|
@@ -74,7 +74,11 @@ class ChatController extends BaseController
|
|
|
//客户的未读消息总数
|
|
|
public function actionUnReadMsgCount()
|
|
|
{
|
|
|
- $c = ChatService::getUnReadMsgCount(intval($this->userId), 'message');
|
|
|
+ $c = 0;
|
|
|
+ //未登录也会访问这个接口
|
|
|
+ if ($this->userId > 0) {
|
|
|
+ $c = ChatService::getUnReadMsgCount($this->userId, 'message');
|
|
|
+ }
|
|
|
util::success(['msg_count' => $c]);
|
|
|
}
|
|
|
|