fix not filter categories frontend pages.
This commit is contained in:
parent
d203c115c5
commit
91346e6fe2
|
@ -50,10 +50,10 @@ module AnnouncementsHelper
|
||||||
top_anns = []
|
top_anns = []
|
||||||
tags = page.tags
|
tags = page.tags
|
||||||
if !tags.blank?
|
if !tags.blank?
|
||||||
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.filter_by_tags(tags).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count).to_a
|
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.filter_by_categories(page.categories || [],false).filter_by_tags(tags).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count).to_a
|
||||||
else
|
else
|
||||||
if !params["source"].present?
|
if !params["source"].present?
|
||||||
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil, :is_top.ne => true).can_display.is_approved.filter_by_categories([],false).filter_by_tags.to_a
|
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil, :is_top.ne => true).can_display.is_approved.filter_by_categories(page.categories || [],false).filter_by_tags.to_a
|
||||||
feeds_anns = get_feed_announcements("index")
|
feeds_anns = get_feed_announcements("index")
|
||||||
else
|
else
|
||||||
announcements = []
|
announcements = []
|
||||||
|
@ -63,9 +63,9 @@ module AnnouncementsHelper
|
||||||
# (OrbitHelper.page_number == 1 or OrbitHelper.page_number.nil?) &&
|
# (OrbitHelper.page_number == 1 or OrbitHelper.page_number.nil?) &&
|
||||||
if !params["source"].present?
|
if !params["source"].present?
|
||||||
if !tags.blank?
|
if !tags.blank?
|
||||||
top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories([],false).filter_by_tags(tags).to_a
|
top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories(page.categories || [],false).filter_by_tags(tags).to_a
|
||||||
else
|
else
|
||||||
top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories([],false).filter_by_tags.to_a
|
top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories(page.categories || [],false).filter_by_tags.to_a
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue