update news homepage

This commit is contained in:
nccu 2014-11-12 18:26:22 +08:00
parent 87f62e4307
commit 1b227985dc
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ class NewsController < ApplicationController
def widget def widget
params = OrbitHelper.params params = OrbitHelper.params
!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"}
news = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.order_by(sort).filter_by_widget_categories.filter_by_tags(OrbitHelper.widget_tags) news = NewsBulletin.where(:title.ne => "",:is_preview.in=>[false,nil]).is_approved.order_by(:created_at=>'desc').filter_by_widget_categories.filter_by_tags(OrbitHelper.widget_tags) if news.nil?
page = Page.where(:module => "news").first rescue nil page = Page.where(:module => "news").first rescue nil
ma = ModuleApp.find_by_key("news") rescue nil ma = ModuleApp.find_by_key("news") rescue nil
categories = ma.categories.enabled.collect do |cat| categories = ma.categories.enabled.collect do |cat|