From 1abcd2a43e6f36d49c683940a6913b38bb5d9740 Mon Sep 17 00:00:00 2001 From: gonglexin <18008490802@163.com> Date: Thu, 23 Oct 2014 00:16:07 +0800 Subject: [PATCH] =?UTF-8?q?#1275=20=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=E5=8A=A8=E6=80=81=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 3555a0b0c..99b21d8cc 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -503,20 +503,8 @@ module CoursesHelper activities[news.course_id]+=1 end - #feedbackc_count - JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess| - activities[jourformess.jour_id]+=1 - end - - #activities!=0 - i=0; - courses.each do |course| - id=course.id - if activities[id]==0 - activities[id]=1 - end - end - + # 动态数 + 1 ( 某某创建了该课程 ) + activities.each_pair { |key, value| activities[key] = value + 1 } return activities end