Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_home
p31729568 5 years ago
commit 7ba4a3f4c9

@ -142,7 +142,7 @@ class Competitions::CompetitionsController < Competitions::BaseController
}
end
else
@records = @records.includes(:team_members, user: :user_extension).limit(@competition.awards_count)
@records = @records.includes(:team_members, :competition_prize_users, user: :user_extension).limit(@competition.awards_count)
end
end

@ -18,6 +18,10 @@ class CompetitionTeam < ApplicationRecord
team_type.zero?
end
def competition_prize
competition_prize_users.take&.competition_prize&.name
end
def personal_team_type?
team_type == 1
end

@ -6,6 +6,7 @@ json.user_ranks @user_ranks.each do |user_rank|
json.user_name user_rank.user.real_name
json.cost_time rank == 0 && user_rank.cost_time ? "--" : com_spend_time(user_rank.cost_time)
json.score rank == 0 ? "--" : user_rank.score.round(2)
json.competition_prize user_rank.competition_prize
end
json.teams @records.each do |record|
@ -18,4 +19,5 @@ json.teams @records.each do |record|
json.school_name school_name
json.score record&.score&.round(2)
json.spend_time record.cost_time ? com_spend_time(record.cost_time) : "--"
json.competition_prize record.competition_prize
end
Loading…
Cancel
Save