Bläddra i källkod

查询接口修改

8 år sedan
förälder
incheckning
eed6256cbc

+ 10 - 7
src/server/models/sessions/sessions.js

@ -262,13 +262,16 @@ class Sessions extends RedisModel {
            let sessions = [];
            res.forEach(function (session) {
                sessions.push({
                    id: session.id,
                    name: session.name,
                    type: session.type,
                    business_type: session.business_type,
                    create_date: session.create_date
                })
                //最近列表用于转发,过滤不可用的咨询
                if(session.last_content_type != CONTENT_TYPES.TopicEnd){
                    sessions.push({
                        id: session.id,
                        name: session.name,
                        type: session.type,
                        business_type: session.business_type,
                        create_date: session.create_date
                    })
                }
            });
            ModelUtil.emitOK(self.eventEmitter, sessions);

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

@ -139,14 +139,13 @@ class SessionRepo {
     * @param handler
     */
    static findAllByTimestampAndType(userId, dateSpan, handler) {
        let sql = "SELECT DISTINCT s.id, CASE WHEN TYPE = 2 THEN d.name ELSE s.name END 'name', s.type, s.create_date, s.business_type " +
        let sql = "SELECT DISTINCT s.id, CASE WHEN TYPE = 2 THEN d.name ELSE s.name END 'name',s.last_content_type, s.type, s.create_date, s.business_type " +
        "FROM sessions s, participants p " +
        "LEFT JOIN doctors d ON p.participant_id = d.id " +
        "WHERE s.id = p.session_id AND s.last_sender_id <> 'system' " +
        "AND UNIX_TIMESTAMP(s.last_message_time) > UNIX_TIMESTAMP(NOW()) - ? " +
        "AND p.participant_id <> ? AND s.type <> 1 AND s.business_type = 1 " +
        "AND s.id in (select s.id from sessions s, participants p where s.id = p.session_id and p.participant_id = ?) " +
         "AND s.id in (select s.id from participants p1, topics t where t.end_message_id is null and  p1.session_id = t.session_id and p1.participant_id = ?) " +
         "ORDER BY s.last_message_time DESC";
        ImDb.execQuery({

+ 7 - 7
src/server/resources/config/config.dev.js

@ -2,10 +2,10 @@
// IM数据库配置
let imDbConfig = {
    host: '172.19.103.77',
    user: 'root',
    password: '123456',
    database: 'ichat',
    host: '172.19.103.85',
    user: 'linzhou',
    password: 'linzhou',
    database: 'im_new',
    connectionLimit: '50',
    charset: 'utf8mb4'
};
@ -14,12 +14,12 @@ let imDbConfig = {
let redisConfig = {
    host: '192.168.1.220',
    port: 6379,
    db: 9
    db: 1
};
// 三师后台
let wlyyServerConfig = {
    host: '172.19.103.87',
    host: '172.19.103.88',
    port: 9092,
    model:"/wlyy"
};
@ -69,7 +69,7 @@ let topicConfig = {
exports.app = 'IM.Server';
exports.version = '2.0.0';
exports.debug = true;
exports.serverPort = 3008;
exports.serverPort = 3000;
exports.sessionExpire = 1800;
exports.showSQL = true;