From 07512a578dda36b07eb89c2872ddac5264dc0177 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 5 Aug 2019 16:44:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E7=9A=84=E8=AF=BE=E5=A0=82=E5=88=97=E8=A1=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index 5068e38e..79b8c068 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -508,7 +508,7 @@ class Course < ActiveRecord::Base # 课堂实训作业的评测次数 def evaluate_count - course_user_ids = self.members.map(&:user_id) + course_user_ids = self.students.map(&:user_id) shixun_ids = self.homework_commons.joins(:homework_commons_shixuns).where(homework_type: 4).pluck(:shixun_id) return 0 if shixun_ids.blank? Game.joins(:challenge).where(challenges: {shixun_id: shixun_ids}, games: {user_id: course_user_ids}).sum(:evaluate_count)