|
@@ -923,8 +923,9 @@ func (b *MessaggeService) SaveAutoReplyMsg(userType, entId, entUserId, userId in
|
|
func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
|
|
func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
|
|
updateMap := map[string]interface{}{}
|
|
updateMap := map[string]interface{}{}
|
|
sqlStr := ""
|
|
sqlStr := ""
|
|
|
|
+ log.Println("UpdateReadById", in.PositionId, in.NewUserId, in.SendId, in.EntUserId, in.UserType)
|
|
switch in.UserType {
|
|
switch in.UserType {
|
|
- case 1: //点对点聊天
|
|
|
|
|
|
+ case 2: //点对点聊天
|
|
updateMap = map[string]interface{}{
|
|
updateMap = map[string]interface{}{
|
|
"own_type": 2,
|
|
"own_type": 2,
|
|
"own_id": in.PositionId,
|
|
"own_id": in.PositionId,
|
|
@@ -953,7 +954,7 @@ func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
|
|
"chat_group_id": in.SendId,
|
|
"chat_group_id": in.SendId,
|
|
}
|
|
}
|
|
IC.BaseMysql.Update(util.SOCIALIZE_SUMMARY, updateQuery, map[string]interface{}{"unread": 0})
|
|
IC.BaseMysql.Update(util.SOCIALIZE_SUMMARY, updateQuery, map[string]interface{}{"unread": 0})
|
|
- case 2: // 客服聊天
|
|
|
|
|
|
+ case 1: // 客服聊天
|
|
unreadSql := ""
|
|
unreadSql := ""
|
|
positionStr := GetUserAllPosition(in.NewUserId)
|
|
positionStr := GetUserAllPosition(in.NewUserId)
|
|
if in.SendType == 1 { //1客服
|
|
if in.SendType == 1 { //1客服
|
|
@@ -972,6 +973,8 @@ func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
|
|
"AND a.own_id in (%s) ", util.SOCIALIZE_MESSAGE_MAILBOX, positionStr)
|
|
"AND a.own_id in (%s) ", util.SOCIALIZE_MESSAGE_MAILBOX, positionStr)
|
|
unreadSql = fmt.Sprintf("UPDATE %s SET unread = 0 WHERE user_id = %d AND ent_id = %d", util.SOCIALIZE_SUMMARY, in.NewUserId, in.SendId)
|
|
unreadSql = fmt.Sprintf("UPDATE %s SET unread = 0 WHERE user_id = %d AND ent_id = %d", util.SOCIALIZE_SUMMARY, in.NewUserId, in.SendId)
|
|
}
|
|
}
|
|
|
|
+ log.Println("UpdateReadById", unreadSql)
|
|
|
|
+
|
|
IC.BaseMysql.UpdateOrDeleteBySql(sqlStr)
|
|
IC.BaseMysql.UpdateOrDeleteBySql(sqlStr)
|
|
IC.BaseMysql.UpdateOrDeleteBySql(unreadSql)
|
|
IC.BaseMysql.UpdateOrDeleteBySql(unreadSql)
|
|
}
|
|
}
|