|
@@ -895,7 +895,11 @@ func SynchronousInfo(sender, recipient, conversationType, messageId, userType, e
|
|
case 2: //用户与客服
|
|
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, map[string]interface{}{"id": messageId, "own_id": recipient, "isread": 0}) > 0 {
|
|
if userType == 2 { //发送人是用户
|
|
if userType == 2 { //发送人是用户
|
|
- IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and user_id = %d and customer_service_id = %d and entId = %d THEN unread-1 ELSE 0 END;", util.Socialize_customer_service_user, sender, recipient, entId))
|
|
|
|
|
|
+ //接收人是会话标识 查询客服id
|
|
|
|
+ data := IC.BaseMysql.FindOne(util.SOCIALIZE_CHAT_SESSION, map[string]interface{}{"id": recipient}, "", "")
|
|
|
|
+ if data != nil && len(*data) > 0 {
|
|
|
|
+ IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and user_id = %d and customer_service_id = %d and entId = %d THEN unread-1 ELSE 0 END;", util.Socialize_customer_service_user, sender, quitl.IntAll((*data)["customer_service_id"]), entId))
|
|
|
|
+ }
|
|
} else { //发送人是客服
|
|
} else { //发送人是客服
|
|
IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and user_id = %d and ent_id = %d THEN unread-1 ELSE 0 END;", util.Socialize_summary, recipient, entId))
|
|
IC.BaseMysql.SelectBySql(fmt.Sprintf("update %s set unread=CASE WHEN unread > 0 and user_id = %d and ent_id = %d THEN unread-1 ELSE 0 END;", util.Socialize_summary, recipient, entId))
|
|
}
|
|
}
|