决赛和总排行榜

dev_aliyun
cxt 5 years ago
parent c3d4176b5b
commit 08322e989b

@ -327,9 +327,9 @@ class CompetitionsController < ApplicationController
elsif @type == "决赛" elsif @type == "决赛"
# '92b7vt8x','a7fxenvc','wt2xfzny','xa4m9cng','tng6heyf','am5o73er','9fla2zry','fzp3iu4w','qlsy6xb4' # '92b7vt8x','a7fxenvc','wt2xfzny','xa4m9cng','tng6heyf','am5o73er','9fla2zry','fzp3iu4w','qlsy6xb4'
# 预赛的实训id 第一阶段128913731256 第二阶段1488, 1453, 1487 第三阶段1470, 1473, 1408 # 预赛的实训id 第一阶段128913731256 第二阶段1488, 1453, 1487 第三阶段1470, 1473, 1408
shixun1_id = Shixun.where(:identifier => ['92b7vt8x','a7fxenvc','wt2xfzny']).pluck(:id) shixun1_id = Shixun.where(:identifier => ['ftlc4x38']).pluck(:id)
shixun2_id = Shixun.where(:identifier => ['xa4m9cng','tng6heyf','am5o73er']).pluck(:id) shixun2_id = Shixun.where(:identifier => ['y9npgih2','ucqt7fw3','2p7ouzwk']).pluck(:id)
shixun3_id = Shixun.where(:identifier => ['9fla2zry','fzp3iu4w','qlsy6xb4']).pluck(:id) shixun3_id = Shixun.where(:identifier => ['fj49r7xv','gf2cvxfh','cmoxhtbs']).pluck(:id)
end end
if @competition.competition_scores.where(:competition_stage_id => @stage.id).count == 0 if @competition.competition_scores.where(:competition_stage_id => @stage.id).count == 0
@ -385,7 +385,7 @@ class CompetitionsController < ApplicationController
f_score = team.competition_scores.where(:competition_stage_id => final_stage.try(:id)).first f_score = team.competition_scores.where(:competition_stage_id => final_stage.try(:id)).first
# 预赛记录 # 预赛记录
p_score = team.competition_scores.where(:competition_stage_id => pre_stage.try(:id)).first p_score = team.competition_scores.where(:competition_stage_id => pre_stage.try(:id)).first
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 * 0.80 + p_score.try(:score).to_f * 0.20).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
end end

Loading…
Cancel
Save