huangwenjie преди 4 години
родител
ревизия
bdd01425c7
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 2 2
      src/server/models/sessions/sessions.js
  2. 2 2
      src/server/repository/mysql/session.repo.js

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

@ -1358,8 +1358,8 @@ class Sessions extends RedisModel {
        let patientCount = 0;
        let doctorCount = 0;
        let patientEndCount = 0;
        SessionRepo.findAll(userId, function (err, res) {
        // SessionRepo.findUnEndAll(userId, function (err, res) {
        // SessionRepo.findAll(userId, function (err, res) {
        SessionRepo.findUnEndAll(userId, type,function (err, res) {
            if (err) {
                if(handler)
                {

+ 2 - 2
src/server/repository/mysql/session.repo.js

@ -56,11 +56,11 @@ class SessionRepo {
     * @param userId
     * @param handler
     */
    static findUnEndAll(userId, handler) {
    static findUnEndAll(userId, type,handler) {
        let sql = "select session_id from " + DB_TABLES.Participants + " w where w.participant_id = ? and participant_role =0  group by w.session_id";
        let sys_session = "select session_id from " + DB_TABLES.Participants + " w where w.participant_id = 'system' and participant_role =0  group by w.session_id";
        let sessionSQL = "select id, name, type, create_date,business_type, last_sender_id, last_sender_name, last_content_type, last_content, last_message_time,status from "
            + DB_TABLES.Sessions + " s where s.id in(" + sql + ") and s.id not in ("+sys_session+") and s.`status` = 0";
            + DB_TABLES.Sessions + " s where s.id in(" + sql + ") AND s.type in(" + type + ") and s.id not in ("+sys_session+") and s.`status` = 0";
        ImDb.execQuery({
            "sql": sessionSQL,
            "args": [userId],