Просмотр исходного кода

成员变化的时候时间更新为空问题处理

8 лет назад
Родитель
Сommit
1372ba24ba
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/server/models/sessions/sessions.js

+ 2 - 2
src/server/models/sessions/sessions.js

@ -382,7 +382,7 @@ class Sessions extends RedisModel {
                                // 计算未读消息数
                                // 计算未读消息数
                                let messagesByTimestampKey = RedisModel.makeRedisKey(REDIS_KEYS.MessagesByTimestamp, sessionId);
                                let messagesByTimestampKey = RedisModel.makeRedisKey(REDIS_KEYS.MessagesByTimestamp, sessionId);
                                redis.zcountAsync(messagesByTimestampKey, lastFetchTime, new Date().getTime())
                                redis.zcountAsync(messagesByTimestampKey, lastFetchTime+1, new Date().getTime())
                                    .then(function (count) {
                                    .then(function (count) {
                                        if (!otherUserId) otherUserId = userId;
                                        if (!otherUserId) otherUserId = userId;
                                        ParticipantRepo.findNameById(otherUserId, function (err, res) {
                                        ParticipantRepo.findNameById(otherUserId, function (err, res) {
@ -513,7 +513,7 @@ class Sessions extends RedisModel {
                                // 计算未读消息数
                                // 计算未读消息数
                                let messagesByTimestampKey = RedisModel.makeRedisKey(REDIS_KEYS.MessagesByTimestamp, sessionId);
                                let messagesByTimestampKey = RedisModel.makeRedisKey(REDIS_KEYS.MessagesByTimestamp, sessionId);
                                redis.zcountAsync(messagesByTimestampKey, lastFetchTime, new Date().getTime())
                                redis.zcountAsync(messagesByTimestampKey, lastFetchTime+1, new Date().getTime())
                                    .then(function (count) {
                                    .then(function (count) {
                                        if (!otherUserId) otherUserId = userId;
                                        if (!otherUserId) otherUserId = userId;
                                        ParticipantRepo.findNameById(otherUserId, function (err, res) {
                                        ParticipantRepo.findNameById(otherUserId, function (err, res) {