From b87c51761b3143aabd39a3e9c91596e540325172 Mon Sep 17 00:00:00 2001
From: rearcher <123781007@qq.com>
Date: Mon, 18 Dec 2023 22:24:51 +0800
Subject: [PATCH] fix cve_list sort

---
 apollo/database/proxy/cve.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/apollo/database/proxy/cve.py b/apollo/database/proxy/cve.py
index e92cb14..6210156 100644
--- a/apollo/database/proxy/cve.py
+++ b/apollo/database/proxy/cve.py
@@ -669,10 +669,11 @@ class CveProxy(CveMysqlProxy, CveEsProxy):
             sort_page['limt_size'] = int(per_page)
 
         # sort by host num by default
+        sort_page["order_by"] = data.get("direction", "asc")
         sort_page["order_by_filed"] = data.get('sort', "cve_id")
         if sort_page["order_by_filed"] == "host_num":
-            sort_page["order_by_filed"] = "cve_id, host_num"
-        sort_page["order_by"] = data.get("direction", "asc")
+            sort_page["order_by_filed"] = f"host_num {sort_page['order_by']},cve_id "
+
         return sort_page
 
     def _query_cve_list(self, data):
-- 
Gitee

