diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index b247f5a41..a75a0e698 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -105,7 +105,7 @@ class OrganizationsController < ApplicationController end # 最新动态, 来自我关联的项目和课程 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', 'JournalsForMessage') and + @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;") end