From 193e0bcf84cd9bfa410956318ec0ed54c221c8d7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 9 Mar 2020 16:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index ce7b2dd38..3eb972c38 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -155,8 +155,10 @@ class ChallengesController < ApplicationController def index uid_logger("identifier: #{params}") - @challenges = @shixun.challenges.fields_for_list.joins(:games).where(games: {user_id: current_user.id}) - .select("challenges.*, games.identifier identifier, games.status status") + bases_column = "challenges.id, challenges.subject, challenges.st, challenges.score, challenges.position, + challenges.shixun_id, games.identifier, games.status" + @challenges = @shixun.challenges.joins(:games).where(games: {user_id: current_user.id}) + .select(bases_column) @editable = @shixun.status == 0 # before_action:有判断权限,如果没发布,则肯定是管理人员 @user = current_user @shixun.increment!(:visits)