|
|
@ -452,8 +452,10 @@ class CompetitionsController < ApplicationController
|
|
|
|
sheet1[count_row,11] = com_spend_time user[:s_spend_time].to_i
|
|
|
|
sheet1[count_row,11] = com_spend_time user[:s_spend_time].to_i
|
|
|
|
count_row += 1
|
|
|
|
count_row += 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elsif @competition.identifier == "gcc-dev-2018"
|
|
|
|
elsif @competition.identifier == "gcc-dev-2018" || @competition.identifier == "gcc-task-2019"
|
|
|
|
records = @competition.competition_teams
|
|
|
|
records = @competition.competition_teams
|
|
|
|
|
|
|
|
f_rate = @competition.identifier == "gcc-dev-2018" ? 0.85 : 0.8
|
|
|
|
|
|
|
|
p_rate = @competition.identifier == "gcc-dev-2018" ? 0.15 : 0.2
|
|
|
|
records.each do |team|
|
|
|
|
records.each do |team|
|
|
|
|
# 决赛记录
|
|
|
|
# 决赛记录
|
|
|
|
f_score = team.competition_scores.where(:competition_stage_id => @competition.competition_stages.where(:name => "决赛").first.try(:id)).first
|
|
|
|
f_score = team.competition_scores.where(:competition_stage_id => @competition.competition_stages.where(:name => "决赛").first.try(:id)).first
|
|
|
@ -463,7 +465,7 @@ class CompetitionsController < ApplicationController
|
|
|
|
team[:p_time] = p_score.try(:cost_time)
|
|
|
|
team[:p_time] = p_score.try(:cost_time)
|
|
|
|
team[:f_score] = f_score.try(:score)
|
|
|
|
team[:f_score] = f_score.try(:score)
|
|
|
|
team[:f_time] = f_score.try(:cost_time)
|
|
|
|
team[:f_time] = f_score.try(:cost_time)
|
|
|
|
team[:s_score] = (f_score.try(:score).to_f * 0.85 + p_score.try(:score).to_f * 0.15).try(:round, 2)
|
|
|
|
team[:s_score] = (f_score.try(:score).to_f * f_rate + p_score.try(:score).to_f * p_rate).try(:round, 2)
|
|
|
|
team[:s_spend_time] = f_score.try(:cost_time).to_i + p_score.try(:cost_time).to_i
|
|
|
|
team[:s_spend_time] = f_score.try(:cost_time).to_i + p_score.try(:cost_time).to_i
|
|
|
|
end
|
|
|
|
end
|
|
|
|
records = records.sort do |a, b|
|
|
|
|
records = records.sort do |a, b|
|
|
|
|