dev_forum
cxt 5 years ago
parent 323b13239c
commit d6be63011f

@ -199,7 +199,8 @@ module CoursesHelper
# 获取课堂的作业数
def get_homework_commons_count(course, type, category_id)
HomeworkCommon.where(course_id: course.id, homework_type: type, course_second_category_id: category_id).size
category_id == 0 ? HomeworkCommon.where(course_id: course.id, homework_type: type).size :
HomeworkCommon.where(course_id: course.id, homework_type: type, course_second_category_id: category_id).size
end

Loading…
Cancel
Save