From 2de80c4a641e1c0976a07fc04aeaa1c626b2b9e6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 21 Jun 2019 15:43:31 +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/controllers/student_works_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 4d98ea02b..15b59e863 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -44,8 +44,8 @@ class StudentWorksController < ApplicationController # 统一设置的作业取所有学生,否则取已发布的分班学生 students = @homework.unified_setting? ? @course.students : @course.students.where(course_group_id: @homework.published_settings.pluck(:course_group_id)) unless params[:search].blank? - @members = students.joins(:user).where("user_id != #{current_user.id} and - concat(users.lastname, users.firstname) like ?", "%#{params[:search]}%") + @members = students.joins(user: :user_extensions).where("user_id != #{current_user.id} and (concat(users.lastname, users.firstname) + like ? or user_extensions.student_id like ?)", "%#{params[:search]}%", "%#{params[:search]}%") else # 没有搜索条件时搜索课堂所有未提交的学生