fix feed annc error

This commit is contained in:
chiu 2020-04-08 20:55:16 +08:00
parent 4fbb66d19d
commit c939216c6d
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ module AnnouncementsHelper
def get_feed_annc(type,site_source,locale) def get_feed_annc(type,site_source,locale)
ma_key = 'announcement' ma_key = 'announcement'
if type == "index" if type == "index"
categories = Array(OrbitHelper.widget_categories) categories = Array(OrbitHelper.page_categories)
elsif type == "widget" elsif type == "widget"
categories = Array(OrbitHelper.widget_categories) categories = Array(OrbitHelper.widget_categories)
else else
@ -169,7 +169,7 @@ module AnnouncementsHelper
rest_anns = rest_all_anns.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]} rest_anns = rest_all_anns.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]}
all_sorted = top_anns.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]} + rest_anns all_sorted = top_anns.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]} + rest_anns
else else
all_sorted = feeds_anns.sort{|v1,v2| [v2['is_top'],v2["postdate"]]<=>[v1['is_top'],v1["postdate"]]} all_sorted = feeds_anns.select{|v| v['is_top']}.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]} + feeds_anns.select{|v| v['is_top'] != true}.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]}
end end
all_filter = filter_by_keywords(all_sorted,params[:keywords]) all_filter = filter_by_keywords(all_sorted,params[:keywords])
else else