From 213dc6a0afd480cb4f921ce8cf26e28f76619b7e Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 14 Mar 2019 11:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AF=84=E6=B5=8B=E6=97=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=9C=E4=B8=9A=E5=88=86=E6=95=B0=EF=BC=88?= =?UTF-8?q?=E4=B8=BA=E8=BF=81=E7=A7=BB=E6=95=B0=E6=8D=AE=E5=81=9A=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2e6c2865..d431cbfd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -6793,7 +6793,9 @@ def update_myshixun_work_score myshixun end work.update_time = Time.now - work.final_score = final_score + + # 为迁移的数据做特殊处理, 若分数小于当前通关分数则不更新 + work.final_score = final_score if work.final_score.nil? || final_score > work.final_score score = work.final_score + work.eff_score - work.late_penalty work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) unless work.ultimate_score #logger.info("#############work_score: #{score}")