Update archive_files_controller.rb

finish
This commit is contained in:
chiu 2019-09-19 19:20:50 +08:00
parent 19cac89286
commit a2cf89f090
1 changed files with 2 additions and 2 deletions

View File

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