diff --git a/server/info/internal/logic/infologic.go b/server/info/internal/logic/infologic.go index cd61b2e1..2030eb57 100644 --- a/server/info/internal/logic/infologic.go +++ b/server/info/internal/logic/infologic.go @@ -49,6 +49,7 @@ type InfoType struct { } type ModuleQuery struct { + TableName string ModuleName string ModuleQuery map[string]struct{} } @@ -105,6 +106,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r mquery.ModuleQuery[strings.Join(mlist[1:], ",")] = struct{}{} } else { mquery := &ModuleQuery{ + TableName: mtable, ModuleName: mtable, ModuleQuery: map[string]struct{}{strings.Join(mlist[1:], ","): {}}} mquerys[mtable] = mquery @@ -113,7 +115,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 ", mquery.EncodeQuery("metadata"), mquery.ModuleName, cond) + 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 if err == gorm.ErrRecordNotFound {