fix error

This commit is contained in:
chiu 2020-09-01 14:24:28 +08:00
parent 42586bb546
commit aca4818b7b
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ module BulletinModel
AnnsCache.where(parent_id:self.id).destroy AnnsCache.where(parent_id:self.id).destroy
elsif self.class == Bulletin || (self.class == Page && self.module == "announcement") elsif self.class == Bulletin || (self.class == Page && self.module == "announcement")
if self.class == Bulletin if self.class == Bulletin
BulletinFeedCache.where(:uid.in => BulletinFeed.where(:tag_ids.in => Array(self.tag_ids).collect{|v| v.to_s}).pluck(:uid)).destroy tmp_tag_ids = (Array(self.tag_ids) + Array(Bulletin.find(self.id).tag_ids)).uniq
BulletinFeedCache.where(:uid.in => BulletinFeed.where(:tag_ids.in => tmp_tag_ids.collect{|v| v.to_s}).pluck(:uid)).destroy
end end
AnnsCache.all.destroy AnnsCache.all.destroy
end end