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