瀏覽代碼

Merge branch 'dev' of Amoy/im.doctor into feature-1.2.6

linzhuo 8 年之前
父節點
當前提交
e96ae0ddff

+ 9 - 1
src/doctor/models/group.js

@ -92,7 +92,15 @@ class GroupMessage extends BaseModel {
                                        new Patient().pushGroupMessage(msg);
                                    },
                                    function () {
                                        Doctor.pushMessage(message, 'group_msg');
                                        let msg = {
                                            from: message.from,
                                            to: userId,
                                            contentType: message.contentType,
                                            content: message.content,
                                            msgId: groupMsg[0].msg_id,
                                            group: message.group
                                        };
                                        Doctor.pushMessage(msg, 'group_msg');
                                        // 更新用户组内消息摘要
                                        let at = message.at == userId ? 1 : 0;

+ 10 - 1
src/doctor/models/patient.js

@ -120,8 +120,17 @@ class Patient extends BaseModel {
            self.sendConsultWechatReplyTempMsg(message);
            return;
        }
        groupRepo.getOnGroupMsg(message.msgId, function (err, result) {
            if (err) {
                modelUtil.emitDbError(self.eventEmitter, "get group msg info failed", err);
            }
        patientClient.socketServer.sockets.emit('message',groupRepo.getOnGroupMsg(message.msgId));
            var msg = result ? result[0] : "";
            if (msg) {
                patientClient.socketServer.sockets.emit('message', msg);
            }
        })
    };
    /**

+ 2 - 2
src/doctor/public/html/socket/test.html

@ -42,7 +42,7 @@
<script src="/socket.io/socket.io.js"></script>
<script>
    var socket = io.connect();
    socket.emit('login', {userId: $('#patient_id').val(), password: $('#password').val()});
    socket.on('message', function (data) {
        console.log(data.message);
    });
@ -60,7 +60,7 @@
    });
    $('#login').click(function () {
        socket.emit('login', {userId: $('#patient_id').val(), password: $('#password').val()});
    });
    $('#logout').click(function () {

+ 1 - 1
src/doctor/repository/group.repo.js

@ -95,7 +95,7 @@ exports.getMembersAvatar = function (groups, handler) {
};
exports.getGroupConsultInfo = function (code, handler) {
    var sql = "select t.* from wlyy_talk_group g join wlyy_consult_team t on g.consult_code = t.consult where g.code = ? and g.type = 1";
    var sql = "select t.* from wlyy_talk_group g join wlyy_consult_team t on g.consult_code = t.consult where g.code = ? and g.type = 1 and t.status = 0 and t.del = '1'";
    wlyyRepo.execQuery({
        "sql": sql,

+ 2 - 2
src/doctor/repository/notify.msg.repo.js

@ -21,8 +21,8 @@ let imRepo = require("./database/im.db.js");
 */
exports.save = function(to, contentType, title, content, message, has_pushed, delay, handler) {
    imRepo.execQuery({
        "sql": "INSERT INTO push_notify (to_uid, type, title, content, data, delay, has_pushed) VALUES (?,?,?,?,?,?)",
        "args": [to, contentType, title, content, message, has_pushed],
        "sql": "INSERT INTO push_notify (to_uid, type, title, content, data, delay, has_pushed) VALUES (?,?,?,?,?,?,?)",
        "args": [to, contentType, title, content, message,delay, has_pushed],
        "handler": handler
    });
};