diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb index f5a3da9c..537a7e19 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb @@ -9,7 +9,11 @@ class Panel::Announcement::FrontEnd::BulletinsController < ObitWidgetController # GET /bulletins.xml def index - @bulletins = Bulletin.desc("postdate") + + date_now = Time.now + + @bulletins = Bulletin.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate) + get_categorys end diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index 9c545a13..33f475c4 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -61,11 +61,13 @@ class Bulletin def self.widget_datas - date_now = Date.today + date_now = Time.now # find(:all, :conditions => {:postdate => {"$lte" => Date.today}, deadline: nil} ).desc( :is_top, :postdate) - where( :postdate.lte => date_now ).where( :deadline => nil ).desc(:is_top, :postdate) + # where( :postdate.lte => date_now ).where( :deadline => nil ).desc(:is_top, :postdate) # any_of({ :title => "test" },{:deadline => nil, :title => "123"}) + any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).limit(5) + end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb index ce18ae2d..d6340a85 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb @@ -7,18 +7,14 @@
<%= t('bulletin.status') %> | <%= t('bulletin.postdate') %> | -<%= t('bulletin.deadline') %> | <%= t('bulletin.category') %> | <%= t('bulletin.title') %> |
---|---|---|---|---|
<%= post.postdate %> | -<%= (post.deadline) ? post.deadline : t('bulletin.no_deadline') %> | <%= post.bulletin_category.i18n_variable[I18n.locale] %> | <%= link_to post.title, panel_announcement_front_end_bulletin_path(post) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
index 87d08897..353d630a 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb
@@ -50,7 +50,7 @@
|