个人主页的加入课程为-1

This commit is contained in:
yutao 2015-07-22 17:46:37 +08:00
parent 987a8da994
commit 74c50e155a
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ module UsersHelper
return Course.where("tea_id = ?",user.id).count()
end
def get_join_course_count(user)
return user.coursememberships.count() - get_create_course_count(user)
((user.coursememberships.count() - get_create_course_count(user)) < 0) ? 0 : user.coursememberships.count() - get_create_course_count(user)
end
def get_homework_commons_count(user)
return HomeworkCommon.where("user_id = ?",user.id).count()