This commit is contained in:
nccu 2014-11-07 20:17:19 +08:00
parent 141851568e
commit 0c1fc57f15
1 changed files with 1 additions and 0 deletions

View File

@ -16,6 +16,7 @@ class AnnouncementsController < ApplicationController
announcements_count = announcements.count announcements_count = announcements.count
keyword = params[:unit] keyword = params[:unit]
elsif params[:tag] elsif params[:tag]
!params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"}
announcements = Bulletin.where(:title.ne => "" ,:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_categories(["all"]).filter_by_tags([params[:tag]]) announcements = Bulletin.where(:title.ne => "" ,:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_categories(["all"]).filter_by_tags([params[:tag]])
else else
!params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"} !params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"}