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