diff --git a/app/controllers/competitions/competitions_controller.rb b/app/controllers/competitions/competitions_controller.rb index b2f93be4c..1eaa0dc22 100644 --- a/app/controllers/competitions/competitions_controller.rb +++ b/app/controllers/competitions/competitions_controller.rb @@ -44,6 +44,12 @@ class Competitions::CompetitionsController < Competitions::BaseController def common_header @competition = current_competition @competition_modules = @competition.unhidden_competition_modules + + # 未登录、未获奖用户,不展示获奖证书栏目 + if !current_user.logged? || !current_competition.finished? || !current_competition.competition_prize_users.exists?(user: current_user) + @competition_modules = @competition_modules.select { |mod| mod.name != '获奖证书' } + end + @user = current_user current_competition.increment!(:visits)