Browse Source

测试搜索的问题

tags/v1
sylor_huang@126.com 6 years ago
parent
commit
b0f48f421e
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      app/queries/projects/list_query.rb

+ 7
- 7
app/queries/projects/list_query.rb View File

@@ -17,16 +17,16 @@ class Projects::ListQuery < ApplicationQuery
# else
# projects = Project.visible
# end
if params[:user_id].to_i != 2 && params[:user_id].to_i != 0
projects = Project.list_user_projects(params[:user_id])
else
projects = Project.visible
end
scope = projects.includes(:repository, owner: :user_extension).like(params[:search])
# if params[:user_id].to_i != 2 && params[:user_id].to_i != 0
# projects = Project.list_user_projects(params[:user_id])
# else
# projects = Project.visible
# end
projects = Project.visible
scope = projects.includes(:project_category, :project_language, :repository, owner: :user_extension).like(params[:search])
.with_project_type(params[:project_type])
.with_project_category(params[:category_id])
.with_project_language(params[:language_id])
.includes(:project_category, :project_language, :owner)

custom_sort(scope, params[:sort_by], params[:sort_direction])
end


Loading…
Cancel
Save