fix sorting error
This commit is contained in:
parent
89c065b047
commit
e2f03069d0
|
@ -147,7 +147,7 @@ class AnnouncementsController < ApplicationController
|
|||
else
|
||||
feeds_anns = get_feed_announcements("widget")
|
||||
rest_all_anns = feeds_anns + sorted_anns.select{|v| !v.is_top}.take(rest_count).map{|v| data_to_human_type(v)}
|
||||
rest_anns = rest_all_anns.sort_by{|v| v["postdate"]}.take(rest_count)
|
||||
rest_anns = rest_all_anns.sort{|v1,v2| v2["postdate"]<=>v1["postdate"]}.take(rest_count)
|
||||
anns = top_anns + rest_anns
|
||||
end
|
||||
end
|
||||
|
|
|
@ -35,6 +35,10 @@ module Announcement
|
|||
data[key1] = [value1,value2,value3]
|
||||
data_item[key_item1] = [value_item1,value_item2,value_item3]
|
||||
data_item[key_item2] = [value2_item1,value2_item2]
|
||||
require File.expand_path('../../../app/models/anns_cache', __FILE__)
|
||||
if defined? AnnsCache
|
||||
AnnsCache.all.destroy
|
||||
end
|
||||
rescue => e
|
||||
puts ['error in announcement',e]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue