Explorar el Código

Merge branch 'dev/v1.2.6_dx' of SocialPlatform/messageCenter into feature/v1.2.6

duxin hace 2 años
padre
commit
9537a01285
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      service/message_mail_box.go

+ 5 - 2
service/message_mail_box.go

@@ -923,8 +923,9 @@ func (b *MessaggeService) SaveAutoReplyMsg(userType, entId, entUserId, userId in
 func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
 	updateMap := map[string]interface{}{}
 	sqlStr := ""
+	log.Println("UpdateReadById", in.PositionId, in.NewUserId, in.SendId, in.EntUserId, in.UserType)
 	switch in.UserType {
-	case 1: //点对点聊天
+	case 2: //点对点聊天
 		updateMap = map[string]interface{}{
 			"own_type":     2,
 			"own_id":       in.PositionId,
@@ -953,7 +954,7 @@ func (b MessaggeService) UpdateReadById(in *messagecenter.ReadStateReq) {
 			"chat_group_id":  in.SendId,
 		}
 		IC.BaseMysql.Update(util.SOCIALIZE_SUMMARY, updateQuery, map[string]interface{}{"unread": 0})
-	case 2: // 客服聊天
+	case 1: // 客服聊天
 		unreadSql := ""
 		positionStr := GetUserAllPosition(in.NewUserId)
 		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)
 			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(unreadSql)
 	}