From 38ab0c654c65277594f16aa7d5f219cc50d21796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 21 Oct 2021 10:55:01 +0800 Subject: [PATCH] fix error --- app/controllers/admin/feeds_controller.rb | 12 ++++++------ app/models/site_feed_annc.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/admin/feeds_controller.rb b/app/controllers/admin/feeds_controller.rb index cdb2821..dab5821 100644 --- a/app/controllers/admin/feeds_controller.rb +++ b/app/controllers/admin/feeds_controller.rb @@ -2,12 +2,12 @@ class Admin::FeedsController < OrbitAdminController layout :compute_layout helper_method :search_all_words def compute_layout - if action_name== 'annc_content' - false - else - 'back_end' - end - end + if action_name== 'annc_content' + false + else + 'back_end' + end + end def index @site_feeds = SiteFeed.all.group_by(&:remote_site_url) @school_urls = @site_feeds.keys diff --git a/app/models/site_feed_annc.rb b/app/models/site_feed_annc.rb index 0c62abe..281b905 100644 --- a/app/models/site_feed_annc.rb +++ b/app/models/site_feed_annc.rb @@ -20,7 +20,7 @@ class SiteFeedAnnc Array(self[:all_contents_for_feed]).collect do |v| tmp = v if hidden_annc.exclude?(v['id']) && !tmp["title_translations"][locale].blank? - if self.channel_key == "announcement" + if self.channel_key == "announcement" && (tmp["postdate"].blank? || tmp["postdate"].to_time<=Time.now) tmp['statuses'] = [] if self[:top_list].count == 0 || self[:top_list].exclude?(tmp['id']) tmp[:is_top] = false