|
@ -354,12 +354,21 @@ class Sessions extends RedisModel {
|
|
|
.hget(participantsRoleKey, userId) // 用户在此会话中的角色
|
|
|
.zscore(sessionParticipantsKey, userId) // 用户在此会话中最后一次获取未读消息的时间
|
|
|
.zrange(participantsKey, 0, -1)
|
|
|
.zrange(sessionParticipantsKey, 0,-1,'withscores') // 所有用户在此会话中最后一次获取未读消息的时间
|
|
|
.execAsync()
|
|
|
.then(function (res) {
|
|
|
let session = res[0];
|
|
|
let role = res[1];
|
|
|
let lastFetchTime = res[2];
|
|
|
let users = res[3];
|
|
|
let participantsTimeArray = res[4];
|
|
|
let participantsTime = [];
|
|
|
for(var j = 0 ;j<participantsTimeArray.length;j++){
|
|
|
if(j%2!=0)continue;
|
|
|
let participantsTimeJson = {};
|
|
|
participantsTimeJson[participantsTimeArray[j]] = participantsTimeArray[j+1];
|
|
|
participantsTime.push(participantsTimeJson);
|
|
|
}
|
|
|
let sessionName = "";
|
|
|
let otherUserId = "";
|
|
|
if (session.type == SESSION_TYPES.P2P) {
|
|
@ -408,6 +417,7 @@ class Sessions extends RedisModel {
|
|
|
my_role: role,
|
|
|
sender_sex: sex,
|
|
|
sender_birthday: bir,
|
|
|
participantsTimeArray:participantsTime
|
|
|
});
|
|
|
|
|
|
index = (parseInt(index) + 1);
|