From da6af7680180ad59204226b5cfe5608e2f28555f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 17 Jul 2019 14:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E7=9A=84?= =?UTF-8?q?=E9=80=89=E7=94=A8=E5=AE=9E=E8=AE=AD=E5=BC=B9=E6=A1=86=E3=80=81?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=A0=E5=85=A5=E8=AF=BE=E5=A0=82=E6=97=B6?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E6=9C=89=E5=90=8C=E5=AD=A6?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E7=94=A8=E6=88=B7=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 7e2c68aab..b661c06b4 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -883,7 +883,7 @@ class CoursesController < ApplicationController u_extension = current_user.user_extension if params[:student].present? && u_extension.student? same_student_id_users = UserExtension.where.not(user_id: current_user.id).where(student_id: u_extension.student_id, identity: %i[student], school_id: u_extension.school_id).pluck(:user_id) - tip_exception("该课堂已存在同学号的学生,暂时无法加入,请联系老师") if course.students.where(user_id: same_student_id_users).size > 0 + tip_exception("该课堂已存在同学号的学生,暂时无法加入,请联系老师") if course.students.exists?(user_id: same_student_id_users) end # 创建学生身份