Browse Source

Merge branch 'feature-refactor' of http://192.168.1.220:10080/Amoy/im.doctor into feature-refactor

Conflicts:
	src/server/repository/mysql/participant.repo.js
8 years ago
parent
commit
99750d96ed
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/server/models/sessions/sessions.js

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

@ -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});
                }
                }
            })
            })
        }
        }