Browse Source

重新计算组织成员数量

pull/347/head
xxq250 2 years ago
parent
commit
1e70d93a83
1 changed files with 7 additions and 8 deletions
  1. +7
    -8
      app/models/organization.rb

+ 7
- 8
app/models/organization.rb View File

@@ -182,14 +182,6 @@ class Organization < Owner
organization_users.count
end

def teams_count
teams.count
end

def organization_users_count
organization_users.count
end

def real_name
name = lastname + firstname
name = name.blank? ? (nickname.blank? ? login : nickname) : name
@@ -217,4 +209,11 @@ class Organization < Owner
enabling_cla == true
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

Loading…
Cancel
Save