forked from Gitlink/forgeplus
移除匿名用户的项目
This commit is contained in:
parent
de3d67ff37
commit
3229f8ce89
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue