From a025e17daa685599f3f5982101bbdd0cb564753b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 8 Jul 2019 17:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/exercise.rb | 2 +- app/models/poll.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/exercise.rb b/app/models/exercise.rb index 0b4aca8eb..f9efabbd8 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -59,7 +59,7 @@ class Exercise < ApplicationRecord # 根据是否统一发布获取作业的作品列表 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"). where(course_members: {course_group_id: published_settings.pluck(:course_group_id)}) end diff --git a/app/models/poll.rb b/app/models/poll.rb index d37ea8458..381a7f359 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -53,7 +53,7 @@ class Poll < ApplicationRecord # 根据是否统一发布获取作业的作品列表 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"). where(course_members: {course_group_id: published_settings.pluck(:course_group_id)}) end