From 90aaaa544a23810aaf6c28048427d141b52da74f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 8 Jun 2016 11:36:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8A=A8=E6=80=81=E6=8C=89?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 4 ++-- app/helpers/organizations_helper.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 97fd65aa7..b36ef592d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -107,7 +107,7 @@ class OrganizationsController < ApplicationController if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0 @acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and ((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')}))) - order by updated_at desc limit 6;") + order by created_at desc limit 6;") end render :layout => 'base_org_custom' else @@ -273,7 +273,7 @@ class OrganizationsController < ApplicationController course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0 @org_acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and ((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')}))) - order by updated_at desc limit 6;") + order by created_at desc limit 6;") respond_to do |format| format.html{render :layout => 'base_org_custom'} format.js diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4099ea451..cb06bd688 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -105,13 +105,13 @@ module OrganizationsHelper def org_time_by_type obj case obj.act_type when "Message" - obj.act.updated_on + obj.act.created_on when "News" obj.act.created_on when "HomeworkCommon" - obj.act.updated_at + obj.act.created_at when "Issue" - obj.act.updated_on + obj.act.created_on end end