fixed 个人项目列表条件增加标签名查询,索引失效

This commit is contained in:
xxq250 2024-08-29 17:08:31 +08:00
parent 4d75e4a174
commit cbdbc4b25e
1 changed files with 3 additions and 1 deletions

View File

@ -88,7 +88,9 @@ class Projects::ListMyQuery < ApplicationQuery
else
if @home_top_ids.present?
scope = scope.distinct.order("FIELD(projects.id, #{@home_top_ids.join(",")}) desc, projects.#{sort} #{sort_direction}")
else
elsif params[:topic_name].present?
scope = scope.distinct.order("project_topics.id asc, projects.#{sort} #{sort_direction}")
else
scope = scope.distinct.order("projects.#{sort} #{sort_direction}")
end
end