|
|
@ -232,6 +232,11 @@ class HacksController < ApplicationController
|
|
|
|
hacks = hacks.where(category: params[:category])
|
|
|
|
hacks = hacks.where(category: params[:category])
|
|
|
|
end
|
|
|
|
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_by = params[:sort_by] || "hack_user_lastest_codes_count"
|
|
|
|
sort_direction = params[:sort_direction] || "desc"
|
|
|
|
sort_direction = params[:sort_direction] || "desc"
|
|
|
|