|
@@ -728,7 +728,7 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
|
|
|
|
|
|
updateMap = map[string]interface{}{
|
|
|
"own_type": 2,
|
|
|
- "own_id": in.NewUserId,
|
|
|
+ "own_id": in.PositionId,
|
|
|
"send_user_id": in.SendId,
|
|
|
"type": 2,
|
|
|
"isread": 0,
|
|
@@ -736,7 +736,7 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
|
|
|
IC.BaseMysql.Update(util.SOCIALIZE_MESSAGE_MAILBOX, updateMap, map[string]interface{}{"isread": 1, "read_time": time.Now().Local().Format(util.Date_Full_Layout)})
|
|
|
//更新socialize_summary表未读消息数量
|
|
|
updateQuery := map[string]interface{}{
|
|
|
- "my_position_id": in.NewUserId,
|
|
|
+ "my_position_id": in.PositionId,
|
|
|
"your_position_id": in.SendId,
|
|
|
}
|
|
|
IC.BaseMysql.Update(util.SOCIALIZE_SUMMARY, updateQuery, map[string]interface{}{"unread": 0})
|
|
@@ -751,7 +751,7 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
|
|
|
IC.BaseMysql.UpdateOrDeleteBySql(sqlStr)
|
|
|
//更新socialize_summary表未读消息数量
|
|
|
updateQuery := map[string]interface{}{
|
|
|
- "my_position_id": in.NewUserId,
|
|
|
+ "my_position_id": in.PositionId,
|
|
|
"chat_group_id": in.ChatGroupId,
|
|
|
}
|
|
|
IC.BaseMysql.Update(util.SOCIALIZE_SUMMARY, updateQuery, map[string]interface{}{"unread": 0})
|
|
@@ -765,14 +765,14 @@ func (b MessaggeService) FindMessage(in *messagecenter.MessageReq) *[]map[string
|
|
|
"AND a.isread = 0 "+
|
|
|
"AND a.own_id IN (SELECT id FROM %s WHERE user_id = %d)",
|
|
|
util.SOCIALIZE_MESSAGE_MAILBOX, util.BASE_POSITION, in.NewUserId)
|
|
|
- unreadSql = fmt.Sprintf("UPDATE %s SET unread = 0 WHERE user_id = %d", util.Socialize_customer_service_user, in.NewUserId)
|
|
|
+ unreadSql = fmt.Sprintf("UPDATE %s SET unread = 0 WHERE user_id = %d AND customer_service_id = %d", util.Socialize_customer_service_user, in.NewUserId, in.EntUserId)
|
|
|
} else { //2用户
|
|
|
sqlStr = fmt.Sprintf("UPDATE %s a SET a.isread = 1, a.read_time = now( ) "+
|
|
|
"WHERE a.own_type = 2 and a.iswithdraw = 0 "+
|
|
|
"AND a.type IN ( 4,5,6,7 ) "+
|
|
|
"AND a.isread = 0 "+
|
|
|
"AND a.own_id in (%s) ", util.SOCIALIZE_MESSAGE_MAILBOX, positionStr)
|
|
|
- unreadSql = fmt.Sprintf("UPDATE %s SET unread = 0 WHERE user_id = %d", util.SOCIALIZE_SUMMARY, in.NewUserId)
|
|
|
+ unreadSql = fmt.Sprintf("UPDATE %s SET unread = 0 WHERE user_id = %d AND ent_id = %d", util.SOCIALIZE_SUMMARY, in.NewUserId, in.EntId)
|
|
|
}
|
|
|
IC.BaseMysql.UpdateOrDeleteBySql(sqlStr)
|
|
|
IC.BaseMysql.UpdateOrDeleteBySql(unreadSql)
|