修改人数显示

This commit is contained in:
nwb 2014-07-18 11:35:05 +08:00
parent 7898bc1dd7
commit 5272a90227
1 changed files with 9 additions and 1 deletions

View File

@ -114,7 +114,15 @@ module CoursesHelper
# 学生人数计算
# add by nwb
def studentCount course
course.student.count
count = 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
def eventToLanguageCourse event_type, course