|
@ -112,7 +112,7 @@ class Sessions extends RedisModel {
|
|
}
|
|
}
|
|
|
|
|
|
function callBusinessType(sessionId) {
|
|
function callBusinessType(sessionId) {
|
|
if(participantIdArray.length==0&&type == SESSION_TYPES.MUC){
|
|
|
|
|
|
if(type == SESSION_TYPES.MUC){
|
|
callCreate(sessionId, 2);
|
|
callCreate(sessionId, 2);
|
|
}else{
|
|
}else{
|
|
ParticipantRepo.getBusinessType(participantIdArray.join("','"), function (err, businessType) {
|
|
ParticipantRepo.getBusinessType(participantIdArray.join("','"), function (err, businessType) {
|
|
@ -648,6 +648,8 @@ class Sessions extends RedisModel {
|
|
getAllSessionsUnreadMessageCount(userId) {
|
|
getAllSessionsUnreadMessageCount(userId) {
|
|
let self = this;
|
|
let self = this;
|
|
let count = 0;
|
|
let count = 0;
|
|
|
|
let patientCount = 0;
|
|
|
|
let doctorCount = 0;
|
|
SessionRepo.findAll(userId, function (err, res) {
|
|
SessionRepo.findAll(userId, function (err, res) {
|
|
if (err) {
|
|
if (err) {
|
|
ModelUtil.logError("getAllSessionsUnreadMessageCount is failed", err);
|
|
ModelUtil.logError("getAllSessionsUnreadMessageCount is failed", err);
|
|
@ -678,8 +680,13 @@ class Sessions extends RedisModel {
|
|
}
|
|
}
|
|
|
|
|
|
count = count + con;
|
|
count = count + con;
|
|
|
|
if(session.type ==2){
|
|
|
|
patientCount = patientCount+con;
|
|
|
|
}else{
|
|
|
|
doctorCount = doctorCount+con;
|
|
|
|
}
|
|
if (j == res.length - 1) {
|
|
if (j == res.length - 1) {
|
|
ModelUtil.emitOK(self.eventEmitter, {count: count});
|
|
|
|
|
|
ModelUtil.emitOK(self.eventEmitter, {count: count,patient:patientCount,doctor:doctorCount});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|