fix error

This commit is contained in:
chiu 2020-05-28 15:30:16 +08:00
parent f9c368924b
commit bb5e98c6b1
1 changed files with 7 additions and 1 deletions

View File

@ -142,7 +142,13 @@ class AnnouncementsController < ApplicationController
AnnsCache.create(parent_id: subpart.id.to_s,locale: I18n.locale.to_s,filter_result: anns) AnnsCache.create(parent_id: subpart.id.to_s,locale: I18n.locale.to_s,filter_result: anns)
end end
else else
anns = sorted_anns.sample(widget_data_count).map{|v| data_to_human_type(v)} if devide_flag
anns = sorted_anns.sample(widget_data_count).map{|v| data_to_human_type(v)}
top_anns = anns.select{|v| v.is_top}
not_top_anns = anns.select{|v| !v.is_top}
else
anns = sorted_anns.sample(widget_data_count).map{|v| data_to_human_type(v)}
end
end end
elsif devide_flag elsif devide_flag
now_anns = anns_cache.first.filter_result now_anns = anns_cache.first.filter_result