Fix the wrong display order problem in index page when postdate are equal.

This commit is contained in:
BOHUNG 2020-03-11 19:06:45 +08:00
parent 0944cd8777
commit 38022023e0
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class Bulletin
before_destroy :destroy_email
scope :can_display_and_sorted, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lte=>Time.now, :deadline.gte=>Time.now},{:postdate.lte=>Time.now, :deadline=>nil}).order(is_top: :desc,postdate: :desc)}
scope :can_display_and_sorted, ->{where(:is_hidden=>false,:is_preview => false).any_of({:postdate.lte=>Time.now, :deadline.gte=>Time.now},{:postdate.lte=>Time.now, :deadline=>nil}).order(is_top: :desc,postdate: :desc,id: :desc)}
scope :is_approved, ->{where(:approved => true)}
before_create :set_expire