|
|
@ -114,28 +114,13 @@ module CoursesHelper
|
|
|
|
# 学生人数计算
|
|
|
|
# 学生人数计算
|
|
|
|
# add by nwb
|
|
|
|
# add by nwb
|
|
|
|
def studentCount course
|
|
|
|
def studentCount course
|
|
|
|
count = searchStudent(course).count#course.student.count
|
|
|
|
searchStudent(course).count.to_s#course.student.count
|
|
|
|
if count <= 5
|
|
|
|
|
|
|
|
result = count.to_s
|
|
|
|
|
|
|
|
elsif count < 10 && count > 5
|
|
|
|
|
|
|
|
result = "5+"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
result = (count-count % 10).to_s + "+"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
result
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#课程成员数计算
|
|
|
|
#课程成员数计算
|
|
|
|
def memberCount course
|
|
|
|
def memberCount course
|
|
|
|
count = searchStudent(course).count + searchTeacherAndAssistant(course).count
|
|
|
|
count = searchStudent(course).count + searchTeacherAndAssistant(course).count
|
|
|
|
if count <= 5
|
|
|
|
count.to_s
|
|
|
|
result = count.to_s
|
|
|
|
|
|
|
|
elsif count < 10 && count > 5
|
|
|
|
|
|
|
|
result = "5+"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
result = (count-count % 10).to_s + "+"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
result
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def eventToLanguageCourse event_type, course
|
|
|
|
def eventToLanguageCourse event_type, course
|
|
|
|