wsl %!s(int64=2) %!d(string=hai) anos
pai
achega
7f7bb6ba30

+ 1 - 1
src/server/endpoints/v2/session.endpoint.js

@ -105,7 +105,7 @@ router.get("/", function (req, res) {
        patientName = decodeURIComponent(patientName);
    }
    if(status&&businessType&&userId&&size&&page&&patientName){
    if(status&&businessType&&userId&&size&&page){
        sessions.getUserStatusSessions(userId,status,sessionType,businessType,page,size,patientName);
    }else{
        sessions.getUserSessions(userId, page, size, businessType);

+ 3 - 6
src/server/repository/mysql/session.repo.js

@ -214,17 +214,14 @@ class SessionRepo {
                if(sessionType){
                    sessionSQL =  "select s.* from " + DB_TABLES.Sessions + " s, " + DB_TABLES.Participants + " p " +
                        " where s.type='"+sessionType+"' and  ((s.id in(" + sql + ") and s.business_type = ? and s.status = 1) or (s.id in(" + sql1 + ") and s.business_type = ? and s.status = 0)) " +
                        " and s.id = p.session_id and p.participant_id = ? ORDER BY s.last_message_time desc limit "+page+","+pagesize;
                        " and s.id = p.session_id and p.participant_id = ? "+patientNameSql+" ORDER BY s.last_message_time desc limit "+page+","+pagesize;
                }else {
                    sessionSQL =  "select s.* from " + DB_TABLES.Sessions + " s, " + DB_TABLES.Participants + " p " +
                        " where ((s.id in(" + sql + ") and s.business_type = ? and s.status = 1) or (s.id in(" + sql1 + ") and s.business_type = ? and s.status = 0)) " +
                        " and s.id = p.session_id and p.participant_id = ? ORDER BY s.last_message_time desc limit "+page+","+pagesize;
                        " and s.id = p.session_id and p.participant_id = ? "+patientNameSql+" ORDER BY s.last_message_time desc limit "+page+","+pagesize;
                }
                sessionSQL =  "select s.* from " + DB_TABLES.Sessions + " s, " + DB_TABLES.Participants + " p " +
                    " where ((s.id in(" + sql + ") and s.business_type = ? and s.status = 1) or (s.id in(" + sql1 + ") and s.business_type = ? and s.status = 0)) " +
                    // " and s.id = p.session_id and p.participant_id = ? ORDER BY (p.last_fetch_time - s.last_message_time+1)>0,s.create_date desc limit "+page+","+pagesize;
                    " and s.id = p.session_id and p.participant_id = ? "+patientNameSql+" ORDER BY s.last_message_time desc limit "+page+","+pagesize;
                console.log("sql -------------"+sessionSQL);
                log.info("1."+sessionSQL);
                ImDb.execQuery({
                    "sql": sessionSQL,

+ 1 - 1
src/server/resources/config/config.prod.js

@ -4,7 +4,7 @@ let imDbConfig = {
    host: '59.61.92.90',
    user: 'im',
    port:9069,
    password: 'im!)123',
    password: '&}H89@a7&AspSq@L!d34J4&y9sk#1G',
    database: 'im',
    connectionLimit: '100',
    charset : 'utf8mb4'