|
|
@ -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))
|
|
|
|
students = @homework.unified_setting? ? @course.students : @course.students.where(course_group_id: @homework.published_settings.pluck(:course_group_id))
|
|
|
|
unless params[:search].blank?
|
|
|
|
unless params[:search].blank?
|
|
|
|
@members = students.joins(:user).where("user_id != #{current_user.id} and
|
|
|
|
@members = students.joins(user: :user_extensions).where("user_id != #{current_user.id} and (concat(users.lastname, users.firstname)
|
|
|
|
concat(users.lastname, users.firstname) like ?", "%#{params[:search]}%")
|
|
|
|
like ? or user_extensions.student_id like ?)", "%#{params[:search]}%", "%#{params[:search]}%")
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
# 没有搜索条件时搜索课堂所有未提交的学生
|
|
|
|
# 没有搜索条件时搜索课堂所有未提交的学生
|
|
|
|