Browse Source

线上BUG修复

8 years ago
parent
commit
4395867a02
2 changed files with 12 additions and 12 deletions
  1. 9 9
      src/doctor/repository/private.msg.repo.js
  2. 3 3
      src/doctor/repository/stats.msg.repo.js

+ 9 - 9
src/doctor/repository/private.msg.repo.js

@ -102,15 +102,15 @@ exports.findAllP2PWithPatient = function (userId, handler) {
    var sql="SELECT p1. CODE as code , p1. NAME as name, p1.birthday, p1.sex, p1.photo, w.last_content, w.last_content_type, w. TIMESTAMP as timestamp, w.new_msg_count " +
             "FROM msg_p2p p, wlyy.wlyy_patient p1, msg_statistic w " +
             "WHERE (( p.to_uid = p1.`code` AND p.from_uid = ? ) OR ( p.from_uid = p1.`code` AND p.to_uid = ? )) " +
             "AND w.last_content_type IN (1, 2, 3, 5, 6) AND w.uid = ? AND w.peer_uid = p1.`code` AND w.from_gid IS NULL " +
            "GROUP BY p1. CODE, p1. NAME, p1.birthday, p1.sex, p1.photo " +
            "union all " +
            "SELECT p1. CODE AS code, p1. NAME AS name, p1.birthday, p1.sex, p1.photo, w.last_content, t.type, w. TIMESTAMP AS timestamp, w.new_msg_count " +
            "FROM msg_p2p p, wlyy.wlyy_patient p1, msg_statistic w, wlyy.wlyy_consult_team t " +
            "WHERE (( p.to_uid = p1.`code` AND p.from_uid = ? ) OR ( p.from_uid = p1.`code` AND p.to_uid = ? )) " +
            "AND w.last_content_type = 7 AND t.type = 6 " +
            "AND (( t.patient = p.from_uid AND t.doctor = p.to_uid ) OR ( t.patient = p.to_uid AND t.doctor = p.from_uid )) " +
            "AND w.uid = ? AND w.peer_uid = p1.`code` AND w.from_gid IS NULL GROUP BY p1. CODE, p1. NAME, p1.birthday, p1.sex, p1.photo;";
             "AND w.last_content_type IN (0,1, 2, 3, 4, 5, 6) AND w.uid = ? AND w.peer_uid = p1.`code` AND w.from_gid IS NULL " +
             "GROUP BY p1. CODE, p1. NAME, p1.birthday, p1.sex, p1.photo " +
             "union all " +
             "SELECT p1. CODE AS code, p1. NAME AS name, p1.birthday, p1.sex, p1.photo, w.last_content, t.type, w. TIMESTAMP AS timestamp, w.new_msg_count " +
             "FROM msg_p2p p, wlyy.wlyy_patient p1, msg_statistic w, wlyy.wlyy_consult_team t " +
             "WHERE (( p.to_uid = p1.`code` AND p.from_uid = ? ) OR ( p.from_uid = p1.`code` AND p.to_uid = ? )) " +
             "AND w.last_content_type = 7 AND t.type = 6 " +
             "AND (( t.patient = p.from_uid AND t.doctor = p.to_uid ) OR ( t.patient = p.to_uid AND t.doctor = p.from_uid )) " +
             "AND w.uid = ? AND w.peer_uid = p1.`code` AND w.from_gid IS NULL GROUP BY p1. CODE, p1. NAME, p1.birthday, p1.sex, p1.photo;";
    imRepo.execQuery({
        "sql": sql,
        "args": [userId, userId,userId,userId, userId,userId],

+ 3 - 3
src/doctor/repository/stats.msg.repo.js

@ -63,12 +63,12 @@ exports.updatePrivateChatSummary = function (userId, peerId, from, type, content
        var sql ="";
        if(type==7){//结束的咨询
            //userId  = to ,peerId = from, from = from
            sql = "INSERT INTO msg_statistic (uid,uuid,from_uid,peer_uid,msg_type,last_content_type,last_content) " +
                "VALUES (?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE peer_uid=?,last_content_type=?,last_content=?";
            sql = "INSERT INTO msg_statistic (uid,uuid,from_uid,peer_uid,msg_type,last_content_type,last_content,new_msg_count) " +
                "VALUES (?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE peer_uid=?,last_content_type=?,last_content=?";
            // 更新对端的统计信息
            imRepo.execQuery({
                "sql": sql,
                "args": [userId, uuid, from, peerId, 1, type, content, peerId, type, content],
                "args": [userId, uuid, from, peerId, 1, type, content,0, peerId, type, content],
                "handler": handler
            });
        }else{