From 553ec8e010d94e90fba3b92b3b0b3c57cd113123 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 15 Oct 2019 11:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E7=9A=84=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 4 ++-- app/helpers/export_helper.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index bdcc3c96d..84b11814f 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -160,7 +160,7 @@ class HomeworkCommonsController < ApplicationController # 作品状态 0: 未提交, 1 按时提交, 2 延迟提交 if params[:work_status].present? - work_status = params[:work_status].map{|status| status.to_i} + 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 +170,7 @@ class HomeworkCommonsController < ApplicationController # 分班情况 unless params[:course_group].blank? - group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id) + group_user_ids = @course.students.where(course_group_id: params[:course_group].split(",")).pluck(:user_id) # 有分组只可能是老师身份查看列表 @student_works = @student_works.where(user_id: group_user_ids) end diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index 28bef0a89..534a78dc1 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -452,7 +452,7 @@ module ExportHelper end end - out_file_name = "作品附件_#{homework_common&.course&.name}_#{homework_common.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.zip" + out_file_name = "作品附件_#{homework_common.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.zip" out_file_name.gsub!(" ", "-") out_file_name.gsub!("/", "_") out_file = find_or_pack(homework_common, homework_common.user_id, digests.sort){