From 41fd331f115ff7e0896e2573f4459cb877fef15e Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 7 Jul 2017 20:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B7=B2=E4=BA=A4=E4=BA=BA=E6=95=B0=E6=9C=AA=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=88=A0=E9=99=A4=E7=9A=84=E5=AD=A6=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f4a72bc31..8f33079fb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -455,7 +455,7 @@ module ApplicationHelper # 判断作业有多少人提交了 # def had_commit_studentwork_count homework_common - StudentWork.where("work_status !=? and homework_common_id=?",0, homework_common.id).count + StudentWork.where("work_status !=? and homework_common_id=? and is_delete = 0",0, homework_common.id).count end # 未提交作品数统计 @@ -465,7 +465,7 @@ module ApplicationHelper # 未评阅 def had_unevaluate_count homework_common - count = StudentWorksScore.find_by_sql("SELECT count(distinct student_work_id) as count FROM student_works_scores sws, student_works sw, homework_commons hc where hc.id =#{homework_common.id} and sw.homework_common_id=hc.id and sws.student_work_id = sw.id and sws.user_id=#{User.current.id};").first.try(:count).to_i + count = StudentWorksScore.find_by_sql("SELECT count(distinct student_work_id) as count FROM student_works_scores sws, student_works sw, homework_commons hc where hc.id =#{homework_common.id} and sw.homework_common_id=hc.id and sw.is_delete = 0 and sws.student_work_id = sw.id and sws.user_id=#{User.current.id};").first.try(:count).to_i student_count = homework_common.course.student.count return student_count - count end