From 5272a90227d52f60ca2b187e90eebc67cedeff32 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 18 Jul 2014 11:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E6=95=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index b03f6cfa1..033b6405c 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -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