newyslclassrooms
daiao 5 years ago
parent 5490800b40
commit 193e0bcf84

@ -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)

Loading…
Cancel
Save