|
@@ -961,11 +961,11 @@ func (b MessaggeService) WithdrawMessage(in *messagecenter.ReadWithdrawReq) bool
|
|
|
func SynchronousInfo(sender, recipient, conversationType, messageId, userType, entId, chatGroupId int64) {
|
|
|
switch conversationType {
|
|
|
case 1: //1v1用户聊天
|
|
|
- if IC.BaseMysql.Count(util.SOCIALIZE_MESSAGE, map[string]interface{}{"id": messageId, "own_id": recipient, "isread": 0}) > 0 {
|
|
|
+ if IC.BaseMysql.Count(util.SOCIALIZE_MESSAGE_MAILBOX, map[string]interface{}{"messag_id": messageId, "own_id": recipient, "isread": 0}) > 0 {
|
|
|
IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and my_position_id = %d and your_position_id = %d THEN unread-1 ELSE 0 END;", util.Socialize_summary, recipient, sender))
|
|
|
}
|
|
|
case 2: //用户与客服
|
|
|
- if IC.BaseMysql.Count(util.SOCIALIZE_MESSAGE, map[string]interface{}{"id": messageId, "own_id": recipient, "isread": 0}) > 0 {
|
|
|
+ if IC.BaseMysql.Count(util.SOCIALIZE_MESSAGE_MAILBOX, map[string]interface{}{"messag_id": messageId, "own_id": recipient, "isread": 0}) > 0 {
|
|
|
if userType == 2 { //发送人是用户
|
|
|
//接收人是会话标识 查询客服id
|
|
|
data := IC.BaseMysql.FindOne(util.SOCIALIZE_CHAT_SESSION, map[string]interface{}{"id": recipient}, "", "")
|
|
@@ -977,13 +977,13 @@ func SynchronousInfo(sender, recipient, conversationType, messageId, userType, e
|
|
|
}
|
|
|
}
|
|
|
case 3: //一对群
|
|
|
- data := IC.BaseMysql.Find(util.SOCIALIZE_MESSAGE, map[string]interface{}{"id": messageId, "chat_group_id": chatGroupId, "isread": 0}, "own_id", "", -1, -1)
|
|
|
+ data := IC.BaseMysql.Find(util.SOCIALIZE_MESSAGE_MAILBOX, map[string]interface{}{"messag_id": messageId, "chat_group_id": chatGroupId, "isread": 0}, "own_id", "", -1, -1)
|
|
|
if data != nil && len(*data) > 0 {
|
|
|
var ownIds []string
|
|
|
for _, v := range *data {
|
|
|
ownIds = append(ownIds, quitl.InterfaceToStr(v["own_id"]))
|
|
|
}
|
|
|
- IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and chat_group_id = %d and position_id in (%s) THEN unread-1 ELSE 0 END;", util.SOCIALIZE_CHAT_GROUP_PERSON, chatGroupId, strings.Join(ownIds, ",")))
|
|
|
+ IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and chat_group_id = %d and my_position_id in (%s) THEN unread-1 ELSE 0 END;", util.Socialize_summary, chatGroupId, strings.Join(ownIds, ",")))
|
|
|
}
|
|
|
}
|
|
|
}
|