mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
重新计算组织成员数量
This commit is contained in:
@@ -182,14 +182,6 @@ class Organization < Owner
|
|||||||
organization_users.count
|
organization_users.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def teams_count
|
|
||||||
teams.count
|
|
||||||
end
|
|
||||||
|
|
||||||
def organization_users_count
|
|
||||||
organization_users.count
|
|
||||||
end
|
|
||||||
|
|
||||||
def real_name
|
def real_name
|
||||||
name = lastname + firstname
|
name = lastname + firstname
|
||||||
name = name.blank? ? (nickname.blank? ? login : nickname) : name
|
name = name.blank? ? (nickname.blank? ? login : nickname) : name
|
||||||
@@ -217,4 +209,11 @@ class Organization < Owner
|
|||||||
enabling_cla == true
|
enabling_cla == true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def num_users
|
||||||
|
organization_user_ids = self.organization_users.pluck(:user_id).uniq
|
||||||
|
project_member_user_ids = self.projects.joins(:members).pluck("members.user_id").uniq
|
||||||
|
ids = organization_user_ids + project_member_user_ids
|
||||||
|
ids.uniq.size
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user