From e73a262a6b40b66faafb438921ec3de69d862674 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 1 Sep 2023 14:08:46 +0800 Subject: [PATCH] fix --- server/info/internal/logic/infologic.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/info/internal/logic/infologic.go b/server/info/internal/logic/infologic.go index 93d63b43..79432e86 100644 --- a/server/info/internal/logic/infologic.go +++ b/server/info/internal/logic/infologic.go @@ -117,7 +117,12 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s ", mquery.EncodeQuery("metadata"), mquery.TableName, cond) var info InfoType - err := l.svcCtx.MysqlConn.Raw(sqlstr).Scan(&info).Error + raw := l.svcCtx.MysqlConn.Raw(sqlstr) + if raw.Error == gorm.ErrRecordNotFound { + continue + } + + err := raw.Scan(&info).Error if err == gorm.ErrRecordNotFound { continue }