修复:冲突代码回归

This commit is contained in:
yystopf 2023-02-10 16:23:06 +08:00
parent 3a14aa10ce
commit 7bce320113
1 changed files with 3 additions and 6 deletions

View File

@ -11,11 +11,7 @@ class Projects::ListQuery < ApplicationQuery
end end
def call def call
collection = Project.visible collection = main_collection
# 增加私有组织中项目过滤
collection = collection.joins("left join organization_extensions on organization_extensions.organization_id = projects.user_id")
.where("organization_extensions.visibility is null or organization_extensions.visibility in (0,1)")
.where("projects.user_id > 0")
collection = filter_projects(collection) collection = filter_projects(collection)
sort = params[:sort_by] || "updated_on" sort = params[:sort_by] || "updated_on"
@ -56,7 +52,8 @@ class Projects::ListQuery < ApplicationQuery
else else
items = items.by_name_or_identifier(params[:search]) items = items.by_name_or_identifier(params[:search])
end end
items.or(items.where(user_id: Owner.like(params[:search]).pluck(:id))) items.or(main_collection.where(user_id: Owner.like(params[:search]).pluck(:id)))
end end
def by_project_type(items) def by_project_type(items)