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