Hot or top for news home banner
This commit is contained in:
parent
88d562450a
commit
a04e1fd10b
|
@ -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} ).where(is_hot: true).desc(: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} ).any_of(is_hot: true, is_top: true).desc(:postdate)
|
||||
else
|
||||
any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).where(is_hot: true).desc(:postdate)
|
||||
any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).any_of(is_hot: true, is_top: true).desc(:postdate)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Reference in New Issue