dev_course
cxt 5 years ago
parent fc37a72d11
commit a025e17daa

@ -59,7 +59,7 @@ class Exercise < ApplicationRecord
# 根据是否统一发布获取作业的作品列表 # 根据是否统一发布获取作业的作品列表
def all_works def all_works
exercise_users = unified_setting ? exercise_users : ex_users = unified_setting ? exercise_users :
exercise_users.joins("join course_members on exercise_users.user_id=course_members.user_id"). exercise_users.joins("join course_members on exercise_users.user_id=course_members.user_id").
where(course_members: {course_group_id: published_settings.pluck(:course_group_id)}) where(course_members: {course_group_id: published_settings.pluck(:course_group_id)})
end end

@ -53,7 +53,7 @@ class Poll < ApplicationRecord
# 根据是否统一发布获取作业的作品列表 # 根据是否统一发布获取作业的作品列表
def all_works def all_works
poll_users = unified_setting ? poll_users : po_users = unified_setting ? poll_users :
poll_users.joins("join course_members on poll_users.user_id=course_members.user_id"). poll_users.joins("join course_members on poll_users.user_id=course_members.user_id").
where(course_members: {course_group_id: published_settings.pluck(:course_group_id)}) where(course_members: {course_group_id: published_settings.pluck(:course_group_id)})
end end

Loading…
Cancel
Save