diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index fec768a19..1bc1c9d61 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -232,6 +232,11 @@ class HacksController < ApplicationController hacks = hacks.where(category: params[:category]) end + # 语言 + if params[:language] + hacks = hacks.joins(:hack_codes).where(hack_codes: {language: params[:language]}) + end + # 排序 sort_by = params[:sort_by] || "hack_user_lastest_codes_count" sort_direction = params[:sort_direction] || "desc"