From 7d50b915cb44c6a91a6aa612d613b8ed22278f4d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 16:56:45 +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/graduation_tasks_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index fc9c8df45..6bf3d2f8a 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -78,10 +78,10 @@ class GraduationTasksController < ApplicationController # 教师评阅搜索 0: 未评, 1 已评 unless params[:teacher_comment].blank? graduation_work_ids = GraduationWorkScore.where(graduation_work_id: @work_list.map(&:id)).pluck(:graduation_work_id) - if params[:teacher_comment] == 0 - @work_list = @work_list.where.not(id: graduation_work_ids) - elsif params[:teacher_comment] == 1 - @work_list = @work_list.where(id: graduation_work_ids).where.not(work_status: 0) + if params[:teacher_comment].to_i == 0 + @work_list = @work_list.where("work_status != 0") + elsif params[:teacher_comment].to_i == 1 + @work_list = @work_list.where("work_status != 0").where(id: graduation_work_ids) end end