Procházet zdrojové kódy

搜索用户返回结果增加会话ID

Sand před 8 roky
rodič
revize
e1aafb29c3

+ 1 - 0
src/server/models/sessions/sessions.js

@ -889,6 +889,7 @@ class Sessions extends RedisModel {
        let sessionType = 0;
        let sessionName = "";
        message.id = messageId;
        // 发送成员必须处于会话中
        participants.existsParticipant(sessionId, message.sender_id, function (err, res) {
            if (res) {

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

@ -87,7 +87,8 @@ class SearchRepo {
     * @param handler
     */
    static searchUser(sessionIdList, keyword, userTable, page, size, handler) {
        let sql = "SELECT DISTINCT u.id, u.name, u.sex, u.birthdate, u.avatar %s FROM sessions s, participants p, " + userTable +
        let sql = "SELECT DISTINCT s.id session_id, s.name session_name, s.type session_type, s.business_type, u.id user_id, u.name user_name, u.sex, u.birthdate, u.avatar %s" +
            " FROM sessions s, participants p, " + userTable +
            " u WHERE s.id in (?) AND s.id = p.session_id AND p.participant_id = u.id AND u.name like ? limit ?, ?";
        sql = vsprintf(sql, [userTable == DB_TABLES.Doctors ? ', hospital_name' : '']);