修改bug,课程动态报错
This commit is contained in:
parent
f3f590a834
commit
0785384813
|
@ -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
|
||||
|
||||
# 为了首页获取数据基本复制了上面的方法,改变了用户查看权限,增加了对讨论区的识别。
|
||||
|
|
Loading…
Reference in New Issue