作者 yangfu

公告发布修改

@@ -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