Fix home banner for hot news
This commit is contained in:
parent
b6c06c6d4f
commit
88d562450a
|
@ -154,9 +154,9 @@ class NewsBulletin
|
|||
# any_of({ :title => "test" },{:deadline => nil, :title => "123"})
|
||||
|
||||
if category_id.to_s.size > 0
|
||||
find(:all, :conditions => {news_bulletin_category_id: category_id}).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate)
|
||||
find(:all, :conditions => {news_bulletin_category_id: category_id}).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).where(is_hot: true).desc(:postdate)
|
||||
else
|
||||
any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate)
|
||||
any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).where(is_hot: true).desc(:postdate)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue