fixed 组织成员数取组织内成员和组织所有仓库成员组合,加入时间

This commit is contained in:
xxq250 2024-01-29 17:32:46 +08:00
parent c957617263
commit 627332e93a
1 changed files with 8 additions and 1 deletions

View File

@ -4,4 +4,11 @@ json.user do
end
json.team_names user.teams.where("teams.organization_id=?", organization.id).pluck(:nickname)
json.created_at user.created_on.strftime("%Y-%m-%d")
join_date = if user.organization_users.find_by(:organization_id => organization.id).present?
user.organization_users.find_by(:organization_id => organization.id).created_at.strftime("%Y-%m-%d")
elsif user.members.joins(:project).find_by(project: organization.projects).present?
user.members.joins(:project).find_by(project: organization.projects).created_at.strftime("%Y-%m-%d")
else
user.created_on.strftime("%Y-%m-%d")
end
json.created_at join_date