Browse Source

成员变化的时候时间更新为空问题处理

8 years ago
parent
commit
17852c2a78
1 changed files with 2 additions and 15 deletions
  1. 2 15
      src/server/repository/mysql/participant.repo.js

+ 2 - 15
src/server/repository/mysql/participant.repo.js

@ -213,29 +213,16 @@ class ParticipantRepo {
        let sql = "INSERT INTO " + DB_TABLES.Participants + " (session_id,participant_id,participant_role,last_fetch_time) VALUES ";
        let args = [];
        let nowDate = new Date();
        console.error("user",users.join(","));
        for (let j in users) {
            let tokens = users[j].split(":");
            if(tokens.length > 1&&tokens[1]==2){
                continue;
            }
            sql += "(?,?,?,?)";
            args.push(sessionId);
            args.push(tokens[0]);
            if(tokens.length > 1&&tokens[1]==2){
            }else{
                args.push(tokens.length > 1 ? tokens[1] : '0');
            }
            args.push(tokens.length > 1 ? tokens[1] : '0');
            args.push(nowDate);
            sql += ",";
        }
        if(sql.lastIndexOf(",")==sql.length-1){
            sql = sql.substring(0,sql.lastIndexOf(","));
            if (j != users.length - 1) sql += ", ";
        }
        sql += " ON DUPLICATE KEY UPDATE participant_role = VALUES(participant_role)";
        ImDb.execQuery({
            "sql": sql,
            "args": args,