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 f4712fa3e..35d168732 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 @@ -98,20 +98,13 @@ module Redmine # Author lizanle # 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 - else - to = scope.scoped(:order => "#{provider_options[:timestamp]} desc").all(provider_options[:find_options].dup).first.created_on - end - from = (to - days.days) > created_time ? (to - days.days) : created_time.to_date + scope.all(provider_options[:find_options].dup) else - #from = to - Setting.activity_days_default.to_i + if from && to + scope = scope.scoped(:conditions => ["#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to]) + scope.all(provider_options[:find_options].dup) + end end - - if from && to - scope = scope.scoped(:conditions => ["#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to]) - end - scope.all(provider_options[:find_options].dup) end # 为了首页获取数据基本复制了上面的方法,改变了用户查看权限,增加了对讨论区的识别。