移除匿名用户的项目

This commit is contained in:
sylor_huang@126.com 2020-04-21 18:57:24 +08:00
parent de3d67ff37
commit 3229f8ce89
1 changed files with 3 additions and 2 deletions

View File

@ -17,10 +17,11 @@ class Projects::ListQuery < ApplicationQuery
# else
# projects = Project.visible
# end
projects = Project.where("user_id != ?", 2) #匿名用户的项目
if params[:user_id].to_i != 2 && params[:user_id].to_i != 0
projects = Project.list_user_projects(params[:user_id])
projects = projects.list_user_projects(params[:user_id])
else
projects = Project.visible
projects = projects.visible
end
scope = projects.includes(:project_category, :project_language, :repository, owner: :user_extension).like(params[:search])
.with_project_type(params[:project_type])