修改分类数量显示bug

This commit is contained in:
sylor_huang@126.com
2020-03-26 10:19:04 +08:00
parent 73ad4b8a96
commit b30510bf3d
4 changed files with 9 additions and 3 deletions

View File

@@ -101,4 +101,9 @@ class Project < ApplicationRecord
str
end
def self.list_user_projects(user_id)
user_not_show = Project.joins(:members).where("projects.is_public = ? and (projects.user_id != ? or members.user_id != ?)", false, user_id,user_id).pluck(:id).uniq
Project.where.not(id: user_not_show)
end
end