Fix tag sort.

This commit is contained in:
BoHung Chiu 2021-09-29 19:34:56 +08:00
parent 9c4fe707c2
commit 4cc1989932
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ class ArchivesController < ApplicationController
categories = module_app.categories.pluck(:id).map(&:to_s) categories = module_app.categories.pluck(:id).map(&:to_s)
end end
if tags == ["all"] if tags == ["all"]
tags = module_app.tags.pluck(:id).map(&:to_s) tags = module_app.tags.sort_by{|tag| ((module_app.asc rescue true) ? tag.sort_number.to_i : -tag.sort_number.to_i)}.map{|tag| tag.id.to_s}
end end
if params[:data_count].to_i <=0 if params[:data_count].to_i <=0
page_data_count = 0 page_data_count = 0