From 765937425b70d6f5e2f6a4d8a92eacb702574114 Mon Sep 17 00:00:00 2001 From: "Billy.Zheng" Date: Mon, 24 Jun 2024 21:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=20bug:=201.=20=E5=A6=82=E6=9E=9C=E4=B9=8B=E5=89=8D=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E6=8E=92=E5=BA=8F,=E5=B0=B1=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E5=86=8D=E7=94=A8=20id=20=E6=8E=92=E5=BA=8F=E4=BA=86.=202.=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=8C=83=E5=9B=B4=E8=BF=87=E6=BB=A4=E4=B9=8B?= =?UTF-8?q?=E5=90=8E,=E8=87=AA=E5=8A=A8=E6=8E=92=E5=BA=8F=E4=BB=85?= =?UTF-8?q?=E5=BD=93=E4=BB=8E=E6=9D=A5=E6=B2=A1=E6=9C=89=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E8=BF=87=E6=89=8D=E5=81=9A.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/actions/universities/index.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/actions/universities/index.cr b/src/actions/universities/index.cr index 460dec0..0ce9fb5 100644 --- a/src/actions/universities/index.cr +++ b/src/actions/universities/index.cr @@ -85,7 +85,9 @@ class Universities::Index < BrowserAction query = order_by_action(query) - pages, universities = paginate(query.id.desc_order.distinct, per_page: 50) + query = query.id.desc_order unless query.query.ordered? + + pages, universities = paginate(query.distinct, per_page: 50) all_name_inputs = [ "q", "is_985", "is_211", "is_good", "is_exists_remark", "is_marked", @@ -159,7 +161,7 @@ class Universities::Index < BrowserAction if filter_by_column.presence params.from_query["range_min_value"] = min_value.to_s params.from_query["range_max_value"] = max_value.to_s - params.from_query["order_by"] = "#{filter_by_column}_min" if click_on.blank? + params.from_query["order_by"] = "#{filter_by_column}_min" if click_on.blank? && order_by.blank? case filter_by_column when "ranking_2023"