From 1ab39388137209d5941c953d01bdd69a6799beaf Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 5 Jul 2019 10:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=BC=BA=E8=AF=84=E6=88=90?= =?UTF-8?q?=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/homework_absence_penalty_calculation_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/homework_absence_penalty_calculation_job.rb b/app/jobs/homework_absence_penalty_calculation_job.rb index 87f78f311..6e80f2330 100644 --- a/app/jobs/homework_absence_penalty_calculation_job.rb +++ b/app/jobs/homework_absence_penalty_calculation_job.rb @@ -11,7 +11,7 @@ class HomeworkAbsencePenaltyCalculationJob < ApplicationJob homework_common.student_works.where("work_status != 0").each do |student_work| absence_penalty_count = student_work.user.student_works_evaluation_distributions.where(student_work_id: work_ids).count - - student_work.user.student_works_scores.where(student_work_id: work_ids, reviewer_role: 3).group_by(:student_work_id).count + student_work.user.student_works_scores.where(student_work_id: work_ids, reviewer_role: 3).group_by(&:student_work_id).count student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.save