From 877ee82230952d542dd5b021299978ec117761b9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 19:19:59 +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/homework_commons_controller.rb | 1 - app/controllers/zips_controller.rb | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 1a162795a..3cde340c6 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -195,7 +195,6 @@ class HomeworkCommonsController < ApplicationController end if params[:format] == "xlsx" - @work_excel = @work_excel.includes(:student_works_scores, user: :user_extension, myshixun: :games) complete_works = @work_excel.present? ? @work_excel.where("work_status > 0").size : 0 if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index 10baf2454..f4822b96b 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -109,11 +109,11 @@ class ZipsController < ApplicationController work_status = params[:work_status] group_id = params[:course_group] - if work_status.present? + unless work_status.blank? @all_student_works = @all_student_works.where(work_status:work_status) end - if group_id.present? + unless group_id.blank? group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id) @all_student_works = @all_student_works.where(user_id: group_user_ids) end