Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_hs
杨树明 5 years ago
commit 91eaeb16da

@ -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

Loading…
Cancel
Save