fix postdate

This commit is contained in:
nccu 2015-03-17 15:52:04 +08:00
parent 4c07156162
commit 88365ba6c1
1 changed files with 2 additions and 0 deletions

View File

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