diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index 9fa8e26e3..213c38c7f 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -27,7 +27,7 @@ class HacksController < ApplicationController # 筛选过滤与排序 params_filter_or_order # 我解决的编程题数 - user_codes = HackUserLastestCode.mine(current_user).passed.joins(:hack) + user_codes = HackUserLastestCode.joins(:hack).mine(current_user).passed @simple_count = user_codes.where(hacks: {difficult: 1}).count @medium_count = user_codes.where(hacks: {difficult: 2}).count @diff_count = user_codes.where(hacks: {difficult: 3}).count