diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 84b11814f..adfcef74f 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -160,7 +160,8 @@ class HomeworkCommonsController < ApplicationController # 作品状态 0: 未提交, 1 按时提交, 2 延迟提交 if params[:work_status].present? - work_status = params[:work_status].split(",").map{|status| status.to_i} + params_work_status = request.get? ? params[:work_status].split(",") : params[:work_status] + work_status = params_work_status.split(",").map{|status| status.to_i} all_student_works = @student_works.left_joins(:myshixun) @student_works = all_student_works.where(work_status: work_status) @@ -170,7 +171,8 @@ class HomeworkCommonsController < ApplicationController # 分班情况 unless params[:course_group].blank? - group_user_ids = @course.students.where(course_group_id: params[:course_group].split(",")).pluck(:user_id) + group_ids = request.get? ? params[:course_group].split(",") : params[:course_group] + group_user_ids = @course.students.where(course_group_id: group_ids).pluck(:user_id) # 有分组只可能是老师身份查看列表 @student_works = @student_works.where(user_id: group_user_ids) end