mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
add: projects filter choosed
This commit is contained in:
@@ -57,6 +57,11 @@ class Projects::ListMyQuery < ApplicationQuery
|
||||
|
||||
sort = params[:sort_by] || "updated_on"
|
||||
sort_direction = params[:sort_direction] || "desc"
|
||||
scope.order("projects.#{sort} #{sort_direction}")
|
||||
|
||||
if params[:choosed].present? && params[:choosed].is_a?(Array)
|
||||
scope.order("FIELD(id, #{params[:choosed].reverse.join(",")}) desc")
|
||||
else
|
||||
scope.order("projects.#{sort} #{sort_direction}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user