Update archive_files_controller.rb

This commit is contained in:
chiu 2019-09-16 19:08:11 +08:00
parent 432fda7f78
commit 2068cd41ef
1 changed files with 1 additions and 3 deletions

View File

@ -3,14 +3,12 @@ class Admin::ArchiveFilesController < OrbitAdminController
if ArchiveSortOrder.count == 0
ArchiveSortOrder.new('sort_order' => false).save
end
if !params['order_asc'].nil?
if !params['order_asc'].nil?
if params['order_asc'] == 'true'
ArchiveSortOrder.first.update_attributes('sort_order' => true)
elsif params['order_asc'] == 'false'
ArchiveSortOrder.first.update_attributes('sort_order' => false)
end
else
ArchiveSortOrder.first.update_attributes('sort_order' => false)
end
@choose = ArchiveSortOrder.first['sort_order']
@table_fields = [:status, :category, :title, :updated_at,:last_modified,"archive.downloaded_times"]