From e929ec427ed780a8ba7ea32839c45dd75b6e22f8 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 19 Jul 2019 01:03:44 +0800 Subject: [PATCH] =?UTF-8?q?job=E4=BB=BB=E5=8A=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course_member.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/course_member.rb b/app/models/course_member.rb index 52c13dbbf..65849e5de 100644 --- a/app/models/course_member.rb +++ b/app/models/course_member.rb @@ -148,7 +148,7 @@ class CourseMember < ApplicationRecord if teacher_groups.count > 0 member_ids = teacher_groups.where(course_group_id: self.try(:course_group_id)).pluck(:course_member_id).compact - none_group_teachers = teacher_groups.pluck(:course_member_id).size > 0 ? teacher_groups.pluck(:course_member_id).compact.join(',') : -1 + none_group_teachers = teacher_groups.pluck(:course_member_id).compact.size > 0 ? teacher_groups.pluck(:course_member_id).compact.join(',') : -1 teachers = course.teachers.where("course_members.id not in (#{none_group_teachers}) or course_members.id in (#{member_ids.size > 0 ? member_ids.join(',') : -1})") else