forked from Trustie/forgeplus
fixed 项目查询错误
This commit is contained in:
parent
67020b7e73
commit
6c70b680ea
|
|
@ -12,11 +12,17 @@ class Projects::ListQuery < ApplicationQuery
|
|||
|
||||
def call
|
||||
q = Project.visible.by_name_or_identifier(params[:search])
|
||||
|
||||
scope = q
|
||||
.with_project_type(params[:project_type])
|
||||
.with_project_category(params[:category_id])
|
||||
.with_project_language(params[:language_id])
|
||||
if params[:project_type] == 'mirror'
|
||||
scope = q
|
||||
.where(project_type: ["sync_mirror","mirror"])
|
||||
.with_project_category(params[:category_id])
|
||||
.with_project_language(params[:language_id])
|
||||
else
|
||||
scope = q
|
||||
.with_project_type(params[:project_type])
|
||||
.with_project_category(params[:category_id])
|
||||
.with_project_language(params[:language_id])
|
||||
end
|
||||
|
||||
sort = params[:sort_by] || "updated_on"
|
||||
sort_direction = params[:sort_direction] || "desc"
|
||||
|
|
|
|||
Loading…
Reference in New Issue