fixed 项目优化排序

This commit is contained in:
“xxq250” 2022-11-08 17:16:25 +08:00
parent ccbbab0741
commit abfb62f342
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ class Projects::ListQuery < ApplicationQuery
sort = params[:sort_by] || "updated_on"
sort_direction = params[:sort_direction] || "desc"
collection = optimize_sorting(collection, sort)
collection = optimize_sorting(collection, sort) if params[:category_id].present?
custom_sort(collection, sort, sort_direction)
# scope = scope.reorder("projects.#{sort} #{sort_direction}")