Update archive_files_controller.rb

finish!
This commit is contained in:
chiu 2019-09-19 19:19:15 +08:00
parent 93c25e65b0
commit 19cac89286
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ class Admin::ArchiveFilesController < OrbitAdminController
ArchiveCategory.create(category_id: category.id.to_s) ArchiveCategory.create(category_id: category.id.to_s)
end end
end end
cats_with_nil = ArchiveCategory.all.in(sort_number: nil) cats_with_nil = ArchiveCategory.all.in(sort_number: nil).order_by(sort_number: 'desc')
cats_no_nil = ArchiveCategory.all.not_in(sort_number: nil) cats_no_nil = ArchiveCategory.all.not_in(sort_number: nil)
@cats = cats_no_nil.concat(cats_with_nil).collect do |cat| @cats = cats_no_nil.concat(cats_with_nil).collect do |cat|
[categories.where(:_id => cat.category_id).first,cat.sort_number.to_s] [categories.where(:_id => cat.category_id).first,cat.sort_number.to_s]