分班问题

dev_static
daiao 5 years ago
parent 111f0f0fa6
commit 8eca359538

@ -146,7 +146,7 @@ class Course < ApplicationRecord
def teacher_group(user_id)
data =
if teacher_course_groups.exists?(user_id: user_id)
teacher_course_groups.joins(:course_group).where(user_id: user_id)
teacher_course_groups.joins(:course_group).where(user_id: user_id).distinct
.pluck('course_groups.id', 'course_groups.name')
else
course_groups.pluck(:id, :name)

Loading…
Cancel
Save