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