This commit is contained in:
parent
8639609832
commit
f7f03b2094
|
@ -59,9 +59,15 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
# 获取项/课程 news最新列表
|
||||
# params course ID or project ID
|
||||
def news_act_order
|
||||
|
||||
# params course: course ID or project ID
|
||||
def news_act_order(course)
|
||||
a = []
|
||||
course.news.each do |new|
|
||||
unless new.comments.blank?
|
||||
new = new.comments.sort! { |a,b| a.created_on <=> b.created_on}.last.commented
|
||||
end
|
||||
a << new
|
||||
end
|
||||
end
|
||||
|
||||
# Time 2015-03-24 16:38:05
|
||||
|
|
Loading…
Reference in New Issue