newyslclassrooms
daiao 5 years ago
parent 60e596552b
commit d5c0049b15

@ -161,8 +161,9 @@ class ChallengesController < ApplicationController
@pass_games_map = @shixun.challenges.joins(:games).where(games: {status:2}).group(:challenge_id).reorder(nil).count
@play_games_map = @shixun.challenges.joins(:games).where(games: {status:[0,1]}).group(:challenge_id).reorder(nil).count
@challenges = @shixun.challenges.joins("join games on games.challenge_id = challenges.id and games.user_id = #{current_user.id}")
@challenges = @shixun.challenges.joins("left join games on games.challenge_id = challenges.id and games.user_id = #{current_user.id}")
.select(base_columns)
@editable = @shixun.status == 0 # before_action有判断权限如果没发布则肯定是管理人员
@user = current_user
@shixun.increment!(:visits)

Loading…
Cancel
Save