Change sort to use event_date.

This commit is contained in:
chiu 2021-06-16 18:09:52 +08:00
parent 1717bd6d27
commit 53df1ff3a4
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class EventNews
before_destroy :destroy_email 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,id: :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,event_date: :desc,id: :desc)}
scope :is_approved, ->{where(:approved => true)} scope :is_approved, ->{where(:approved => true)}
before_create :set_expire before_create :set_expire