diff --git a/app/controllers/competitions_controller.rb b/app/controllers/competitions_controller.rb index 071cd200..29e14100 100644 --- a/app/controllers/competitions_controller.rb +++ b/app/controllers/competitions_controller.rb @@ -452,8 +452,10 @@ class CompetitionsController < ApplicationController sheet1[count_row,11] = com_spend_time user[:s_spend_time].to_i count_row += 1 end - elsif @competition.identifier == "gcc-dev-2018" + elsif @competition.identifier == "gcc-dev-2018" || @competition.identifier == "gcc-task-2019" 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| # 决赛记录 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[:f_score] = f_score.try(:score) 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 end records = records.sort do |a, b| diff --git a/app/views/competitions/charts.html.erb b/app/views/competitions/charts.html.erb index 723f54e9..5fdbafff 100644 --- a/app/views/competitions/charts.html.erb +++ b/app/views/competitions/charts.html.erb @@ -13,7 +13,7 @@ <% end %> <% @max_min_stage.reverse.each do |section| %> <% stage = section.competition_stage %> - <% if stage.name != "模拟赛" %> + <% if stage.name != "模拟赛" && !stage.name.blank? %> <% if section.min_start_time < Time.now %>