正在显示
2 个修改的文件
包含
4 行增加
和
3 行删除
@@ -40,8 +40,9 @@ const ( | @@ -40,8 +40,9 @@ const ( | ||
40 | ) | 40 | ) |
41 | 41 | ||
42 | const ( | 42 | const ( |
43 | - SqlDeleteUserMsg = "delete from user_msg where company_id=? and msg_type=? and source_id=?" | ||
44 | - SqlUpdateUserMsgPublic = "update user_msg set is_public=? where company_id=? and msg_type=? and source_id=?" | 43 | + SqlDeleteUserMsg = "delete from user_msg where company_id=? and msg_type=? and source_id=?" |
44 | + SqlUpdateUserMsgPublic = "update user_msg set is_public=? where company_id=? and msg_type=? and source_id=?" | ||
45 | + SqlUpdateUserMsgPublicInUsers = "update user_msg set is_public=? where company_id=? and msg_type=? and source_id=? and receive_user_id in (%v)" | ||
45 | ) | 46 | ) |
46 | 47 | ||
47 | func (t *UserMsg) TableName() string { | 48 | func (t *UserMsg) TableName() string { |
@@ -169,7 +169,7 @@ func sendBulletinUserMsg(orm orm2.Ormer, receivers []protocol.VisibleObject, com | @@ -169,7 +169,7 @@ func sendBulletinUserMsg(orm orm2.Ormer, receivers []protocol.VisibleObject, com | ||
169 | return | 169 | return |
170 | } | 170 | } |
171 | } | 171 | } |
172 | - if err = utils.ExecuteSQLWithOrmer(orm, models.SqlUpdateUserMsgPublic, models.Public, companyId, models.MsgTypeBulletin, sourceId); err != nil { | 172 | + if err = utils.ExecuteSQLWithOrmer(orm, fmt.Sprintf(models.SqlUpdateUserMsgPublicInUsers, utils.JoinInt64s(ids, ",")), models.Public, companyId, models.MsgTypeBulletin, sourceId); err != nil { |
173 | log.Error(err.Error()) | 173 | log.Error(err.Error()) |
174 | orm.Rollback() | 174 | orm.Rollback() |
175 | return | 175 | return |
-
请 注册 或 登录 后发表评论