课程的创建动态也要显示

This commit is contained in:
lizanle 2015-04-07 16:32:53 +08:00
parent 84c2e39e6c
commit 60838460fc
1 changed files with 10 additions and 0 deletions

View File

@ -373,6 +373,16 @@ class CoursesService
unless latest_bid.nil?
latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => l(:label_recently_updated_homework,:locale => get_user_language(current_user))}
end
# Time 2015-04-07 14:58:30
# Author lizanle
# Description 添加课程创建动态
if(User.find_by_id(CourseInfos.find_by_course_id(course.id).try(:user_id)))
create_user_name = User.find_by_id(CourseInfos.find_by_course_id(course.id).user_id).realname
latest_course_dynamics << {:type => 5,:time => course.created_at,:message =>l(:label_recently,:locale => get_user_language(current_user)) << create_user_name << l(:label_creat,:locale => get_user_language(current_user))}
end
#每个作业中的最新留言
messages = []
course.homeworks.each do |bid|