From 475ef12cd52067f54a969fe6f70b5d1ddc2bc432 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 27 Jan 2015 16:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/acts_as_activity_provider.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb index a4f0ac21d..f4712fa3e 100644 --- a/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb +++ b/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb @@ -49,8 +49,11 @@ module Redmine end module ClassMethods + # Time 2015-01-27 16:30:47 + # Author lizanle + # Description 用原来的写法from,to更加容易懂 # Returns events of type event_type visible by user that occured between from and to - def find_events(event_type, user, days, created_time, options) + def find_events(event_type, user, from, to, options) provider_options = activity_provider_options[event_type] raise "#{self.name} can not provide #{event_type} events." if provider_options.nil? @@ -93,7 +96,7 @@ module Redmine end # Time 2015-01-27 15:18:33 # Author lizanle - # Description 删除 unless scope.all,因为这个执行查询,并且没有加入时间限制,与下边 scope.all(provider_options[:find_options].dup)的重复查询 + # Description 删除 unless scope.all,因为这个执行查询,并且没有加入时间限制,与下边 scope.all(provider_options[:find_options].dup)重复 if options[:course] if provider_options[:timestamp].include? "updated_on" to = scope.scoped(:order => "#{provider_options[:timestamp]} desc").all(provider_options[:find_options].dup).first.updated_on @@ -102,7 +105,7 @@ module Redmine end from = (to - days.days) > created_time ? (to - days.days) : created_time.to_date else - from = to - Setting.activity_days_default.to_i + #from = to - Setting.activity_days_default.to_i end if from && to