Update archives_controller.rb

This commit is contained in:
chiu 2019-09-20 13:37:58 +08:00
parent b37cd68e24
commit f0ddd898b4
1 changed files with 2 additions and 1 deletions

View File

@ -329,9 +329,10 @@ F cats = files_by_cateogry.keys.collect do |cat|
def get_all_categories_id_sorted
all_categories_with_nil = ArchiveCategory.all.in(sort_number: nil)
all_categories_no_nil = ArchiveCategory.all.not_in(sort_number: nil).order_by(sort_number: 'desc')
all_categories_no_nil.concat(all_categories_with_nil).collect do |cat|
all_categories_id = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat|
cat.category_id.to_s
end
all_categories_id
end
def check_cat_sort_data
categories_temp = ModuleApp.where(:key => "archive").first.categories