mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
修改项目成员的问题
This commit is contained in:
@@ -100,11 +100,11 @@ class Project < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.list_user_projects(user_id)
|
||||
projects = Project.is_private.select(:id)
|
||||
user_not_show_1 = projects.where(user_id: user_id).pluck(:id).uniq
|
||||
projects = Project.is_private.select(:id,:user_id)
|
||||
user_not_show_1 = projects.where("user_id != ?",user_id).pluck(:id).uniq
|
||||
|
||||
user_show_2 = projects.joins(:members).where("members.user_id = ?", user_id).pluck(:id).uniq
|
||||
Project.where.not(id: (user_not_show_1 - user_show_2.uniq))
|
||||
Project.where.not(id: (user_not_show_1 - user_show_2).uniq)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user