添加队员角色

dev_aliyun
anke1460 4 years ago
parent d2cbfd8524
commit 70bb1d0ced

@ -235,8 +235,8 @@ class SourcesService
comp = Competition.find_by_identifier params[:identifier]
team_ids = comp.competition_teams.pluck(:id)
user_team = TeamMember.where(:competition_team_id => team_ids, :user_id => params[:user_id]).first
user_ids =TeamMember.where(:competition_team_id => user_team.try(:competition_team_id)).pluck(:user_id)
{team_user_ids: user_ids}
users =TeamMember.where(:competition_team_id => user_team.try(:competition_team_id))
{team_user_ids: users.as_json(only: [:user_id, :role])}
end
def get_team_ids params

Loading…
Cancel
Save