作者 yangfu

公告发布修改

... ... @@ -40,8 +40,9 @@ const (
)
const (
SqlDeleteUserMsg = "delete from user_msg where company_id=? and msg_type=? and source_id=?"
SqlUpdateUserMsgPublic = "update user_msg set is_public=? where company_id=? and msg_type=? and source_id=?"
SqlDeleteUserMsg = "delete from user_msg where company_id=? and msg_type=? and source_id=?"
SqlUpdateUserMsgPublic = "update user_msg set is_public=? where company_id=? and msg_type=? and source_id=?"
SqlUpdateUserMsgPublicInUsers = "update user_msg set is_public=? where company_id=? and msg_type=? and source_id=? and receive_user_id in (%v)"
)
func (t *UserMsg) TableName() string {
... ...
... ... @@ -169,7 +169,7 @@ func sendBulletinUserMsg(orm orm2.Ormer, receivers []protocol.VisibleObject, com
return
}
}
if err = utils.ExecuteSQLWithOrmer(orm, models.SqlUpdateUserMsgPublic, models.Public, companyId, models.MsgTypeBulletin, sourceId); err != nil {
if err = utils.ExecuteSQLWithOrmer(orm, fmt.Sprintf(models.SqlUpdateUserMsgPublicInUsers, utils.JoinInt64s(ids, ",")), models.Public, companyId, models.MsgTypeBulletin, sourceId); err != nil {
log.Error(err.Error())
orm.Rollback()
return
... ...