dev_forum
jingquan huang 5 years ago
parent 804e9c87b6
commit c8bfb0b4c1

@ -150,7 +150,7 @@ class ChallengesController < ApplicationController
uid_logger("identifier: #{params}")
# 通过调试发现 这里includes(:games)性能会慢10倍
# @challenges = @shixun.challenges.fields_for_list
@challenges = Challenge.fields_for_list.left_outer_joins(:games).where("challenges.shixun_id" => @shixun.id)
@challenges = Challenge.fields_for_list.where(shixun_id: @shixun.id)
# @challenges = Challenge.includes(:games).where("games.user_id" => 12).where(shixun_id: @shixun.id)

Loading…
Cancel
Save