|
@@ -426,7 +426,7 @@ class MessageService extends BaseService
|
|
|
*/
|
|
*/
|
|
|
public function getUnreadCount($userId, $chatKey=0, $type=0)
|
|
public function getUnreadCount($userId, $chatKey=0, $type=0)
|
|
|
{
|
|
{
|
|
|
- $cacheKey = "caches:messages:unReadCount:{$userId}_{$chatKey}_{$type}";
|
|
|
|
|
|
|
+ $cacheKey = "caches:messages:un_{$userId}_{$chatKey}_{$type}";
|
|
|
$data = RedisService::get($cacheKey);
|
|
$data = RedisService::get($cacheKey);
|
|
|
if(RedisService::exists($cacheKey)){
|
|
if(RedisService::exists($cacheKey)){
|
|
|
return $data;
|
|
return $data;
|
|
@@ -502,6 +502,7 @@ class MessageService extends BaseService
|
|
|
// 清除缓存
|
|
// 清除缓存
|
|
|
RedisService::keyDel("caches:messages:bar*");
|
|
RedisService::keyDel("caches:messages:bar*");
|
|
|
RedisService::keyDel("caches:messages:new_*");
|
|
RedisService::keyDel("caches:messages:new_*");
|
|
|
|
|
+ RedisService::keyDel("caches:messages:un_*");
|
|
|
RedisService::keyDel("caches:messages:topList_{$userId}");
|
|
RedisService::keyDel("caches:messages:topList_{$userId}");
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -520,6 +521,7 @@ class MessageService extends BaseService
|
|
|
// 清除缓存
|
|
// 清除缓存
|
|
|
RedisService::keyDel("caches:messages:bar*");
|
|
RedisService::keyDel("caches:messages:bar*");
|
|
|
RedisService::keyDel("caches:messages:new_*");
|
|
RedisService::keyDel("caches:messages:new_*");
|
|
|
|
|
+ RedisService::keyDel("caches:messages:un_*");
|
|
|
RedisService::keyDel("caches:messages:topList_{$userId}");
|
|
RedisService::keyDel("caches:messages:topList_{$userId}");
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -537,6 +539,7 @@ class MessageService extends BaseService
|
|
|
// 清除缓存
|
|
// 清除缓存
|
|
|
RedisService::keyDel("caches:messages:bar*");
|
|
RedisService::keyDel("caches:messages:bar*");
|
|
|
RedisService::keyDel("caches:messages:new_*");
|
|
RedisService::keyDel("caches:messages:new_*");
|
|
|
|
|
+ RedisService::keyDel("caches:messages:un_*");
|
|
|
RedisService::keyDel("caches:messages:topList_{$userId}");
|
|
RedisService::keyDel("caches:messages:topList_{$userId}");
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|