order of announcment fixed

This commit is contained in:
Harry Bomrah 2015-10-08 16:59:05 +08:00
parent 4f7285c67f
commit 5a49d48e3c
1 changed files with 2 additions and 2 deletions

View File

@ -4,9 +4,9 @@ class AnnouncementsController < ApplicationController
params = OrbitHelper.params
feeds_anns = []
if !params['tags'].blank?
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_tags(params['tags']).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count)
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.filter_by_tags(params['tags']).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count)
else
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.order_by(:postdate=>'desc').filter_by_categories.filter_by_tags
announcements = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).and(:title.ne => nil).can_display.is_approved.filter_by_categories.filter_by_tags
feeds_anns = get_feed_announcements("index")
end