修改列表页的搜索问题

This commit is contained in:
sylor_huang@126.com 2020-04-10 19:45:32 +08:00
parent 51f17cfac3
commit 801a630f6d
1 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,9 @@ class Projects::ListQuery < ApplicationQuery
.with_project_category(params[:category_id])
.with_project_language(params[:language_id])
custom_sort(scope, params[:sort_by], params[:sort_direction])
sort = parms[:sort_by] || "updated_on"
sort_direction = params[:sort_direction] || "desc"
scope = scope.order("projects.#{sort} #{sort_direction}")
# custom_sort(scope, params[:sort_by], params[:sort_direction])
end
end