fix postdate

This commit is contained in:
nccu 2015-03-17 15:51:19 +08:00
parent d8a49dfdfa
commit 48487b80ac
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ class Admin::BulletinsController < ApplicationController
bulletins = bulletins.where(:tagged_ids.in => params[:tags]) if !params[:tags].blank?
bulletins = bulletins.where(:is_preview.in=>[false,nil])
bulletins = bulletins.where(:approved.ne => false , :rejected.ne => true)
bulletins = bulletins.where(:postdate.lt=>Time.now)
bulletins = bulletins.desc( :is_top, :postdate).page(page_num).per(per_page)
@ -84,6 +85,7 @@ class Admin::BulletinsController < ApplicationController
end
bulletin_count = bulletin_count.where(:is_preview.in=>[false,nil])
bulletin_count = bulletin_count.where(:approved.ne => false , :rejected.ne => true)
bulletin_count = bulletin_count.where(:postdate.lt=>Time.now)
total_pages = bulletin_count.count
# End