优化课程列表成员数计算

This commit is contained in:
nwb 2014-07-21 13:52:23 +08:00
parent 3a249e7196
commit d8d8473811
2 changed files with 5 additions and 4 deletions

View File

@ -26,11 +26,11 @@ module CoursesHelper
end
# 返回学生数量即roles表中定义的Reporter
def studentCount project
searchStudent(project).count
#def studentCount project
# searchStudent(project).count
# or
# searchStudent(project).count
end
# end
# 判断用户是否是课程的管理员
# add by nwb

View File

@ -43,7 +43,8 @@
</p>
<p class="stats">
<%= content_tag('span', "#{garble @course.members.count}", :class => "info") %>
<%= content_tag('span', l(:label_x_member, :count => @course.members.count)) %>
<%#= content_tag('span', l(:label_x_member, :count => @course.members.count)) %>
<%= content_tag('span', l(:label_x_member, :count => studentCount(@course)+teacherCount(@course))) %>
</p>
<!--gcm-->