From 4fc9926cb9e8921cd41f2989a5bf44aeea169562 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Thu, 21 Sep 2023 11:49:29 +0800 Subject: [PATCH] nacos config --- server/info/internal/logic/infologic.go | 2 +- server/info/internal/logic/infologic_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/info/internal/logic/infologic.go b/server/info/internal/logic/infologic.go index e7e2bc64..27fc79dc 100644 --- a/server/info/internal/logic/infologic.go +++ b/server/info/internal/logic/infologic.go @@ -133,7 +133,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r for _, mquery := range mquerys { - sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s order by ctime dec limit 1", mquery.EncodeQuery("metadata"), mquery.TableName, mquery.Cond) + sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s order by ctime DESC limit 1", mquery.EncodeQuery("metadata"), mquery.TableName, mquery.Cond) raw := l.svcCtx.MysqlConn.Raw(sqlstr) diff --git a/server/info/internal/logic/infologic_test.go b/server/info/internal/logic/infologic_test.go index 0c11f2d4..11bad8a8 100644 --- a/server/info/internal/logic/infologic_test.go +++ b/server/info/internal/logic/infologic_test.go @@ -55,7 +55,7 @@ func TestMain(t *testing.T) { for _, mquery := range mquerys { - sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s order by ctime asc limit 1", mquery.EncodeQuery("metadata"), mquery.TableName, mquery.Cond) + sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s order by ctime dec limit 1", mquery.EncodeQuery("metadata"), mquery.TableName, mquery.Cond) raw := conn.Raw(sqlstr)