From 80d6d36874ce03ce336c1c660ff9594205f0948c Mon Sep 17 00:00:00 2001 From: mofangmin Date: Mon, 12 Aug 2024 10:57:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=B8=B8=E6=88=8F=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=BF=9B=E8=A1=8C=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- call/config.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/call/config.go b/call/config.go index 6ec9a34..6948aea 100644 --- a/call/config.go +++ b/call/config.go @@ -716,11 +716,15 @@ func GetConfigGameList(num int, cond ...int) []*common.ConfigGameList { continue } ret = append(ret, v) - if num > 0 && len(ret) >= num { - return ret - } } - return ret + sort.Slice(ret, func(i, j int) bool { + return ret[i].Sort > ret[j].Sort + }) + if num > 0 && len(ret) >= num { + return ret[:num] + } else { + return ret + } } func GetConfigGameListByID(provider, gameID int) *common.ConfigGameList {