From 5d95f43173dfc6c72463ca8342b58b7801ed2cbf Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 21 Aug 2019 11:06:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E5=93=81=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/homeworks_service.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 59bd5dad4..a21614efc 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -328,10 +328,13 @@ class HomeworksService work.late_penalty = work.work_status == 2 ? homework.late_penalty : 0 work.commit_time = myshixun.created_at > setting_time.publish_time ? setting_time.publish_time : myshixun.created_at work.myshixun_id = myshixun.id - work.update_time = if myshixun_endtime.present? - myshixun_endtime > homework_end_or_late_time ? homework_end_or_late_time : myshixun_endtime + work.update_time = if myshixun_endtime.present? && myshixun_endtime <= homework_end_or_late_time + myshixun_endtime + elsif myshixun.updated_at > homework_end_or_late_time + last_pass_time = games.select{|game| game.status == 2 && game.end_time < homework_end_or_late_time}.map(&:end_time).max + last_pass_time.present? ? last_pass_time : myshixun.created_at else - myshixun.updated_at > homework_end_or_late_time ? homework_end_or_late_time : myshixun.updated_at + myshixun.updated_at end work.final_score = final_score