修改bug,课程动态报错

This commit is contained in:
lizanle 2015-01-30 10:28:31 +08:00
parent f3f590a834
commit 0785384813
1 changed files with 5 additions and 12 deletions

View File

@ -98,21 +98,14 @@ 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
scope.all(provider_options[:find_options].dup)
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
else
#from = to - Setting.activity_days_default.to_i
end
if from && to
scope = scope.scoped(:conditions => ["#{provider_options[:timestamp]} BETWEEN ? AND ?", from, to])
end
scope.all(provider_options[:find_options].dup)
end
end
end
# 为了首页获取数据基本复制了上面的方法,改变了用户查看权限,增加了对讨论区的识别。
# 因为新建了讨论区的内容,没有与项目方法混合,但是 event_type 取值类型还在共用,可能会对项目活动取值性能造成影响