small fix for tag filter

This commit is contained in:
Harry Bomrah 2016-05-05 16:32:43 +08:00
parent fc325dce2d
commit 1d4ddef575
1 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,11 @@ class AnnouncementsController < ApplicationController
end end
if (OrbitHelper.page_number == 1 or OrbitHelper.page_number.nil?) && !params["source"].present? if (OrbitHelper.page_number == 1 or OrbitHelper.page_number.nil?) && !params["source"].present?
top_anns = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil], :is_top => true).and(:title.ne => nil).can_display.filter_by_categories([],false).to_a if !params['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(params['tags']).to_a
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
end
end end
if !feeds_anns.blank? if !feeds_anns.blank?