change order in admin page.

This commit is contained in:
BOHUNG 2020-03-20 12:03:57 +08:00
parent c2e3345228
commit 976f97f4db
1 changed files with 2 additions and 2 deletions

View File

@ -24,9 +24,9 @@ class Admin::WritingsController < OrbitMemberController
end end
if params[:clear] != 'true' if params[:clear] != 'true'
if(params[:new_filter] != nil && params[:new_filter][:type] == 'category') if(params[:new_filter] != nil && params[:new_filter][:type] == 'category')
@writings = Writing.where(:category_id.in=> @filter['category']).order_by(:year=>'desc').page(params[:page]).per(10) @writings = Writing.where(:category_id.in=> @filter['category']).order_by(:year=>'desc',:month=>'desc',:id=>'desc').page(params[:page]).per(10)
else else
@writings = Writing.order_by(:year=>'desc').page(params[:page]).per(10) @writings = Writing.order_by(:year=>'desc',:month=>'desc',:id=>'desc').page(params[:page]).per(10)
end end
else else
redirect_to admin_writings_url redirect_to admin_writings_url