Fix query for top in bulletin
This commit is contained in:
parent
9684189258
commit
b55988af33
|
@ -37,7 +37,7 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
result = eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id'])")
|
result = eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id'])")
|
||||||
end
|
end
|
||||||
date_now = Time.now
|
date_now = Time.now
|
||||||
result.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:created_at)
|
result.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, :created_at)
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_widget
|
def default_widget
|
||||||
|
|
Loading…
Reference in New Issue