diff --git a/server/info/internal/logic/infologic.go b/server/info/internal/logic/infologic.go index 1b91f99b..bafecd32 100644 --- a/server/info/internal/logic/infologic.go +++ b/server/info/internal/logic/infologic.go @@ -48,6 +48,7 @@ type ModuleQuery struct { } func (mquery *ModuleQuery) EncodeQuery(field string) string { + var qstr []byte = []byte("JSON_OBJECT(") for query := range mquery.ModuleQuery { @@ -98,12 +99,16 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r moduleName := mlist[1] cond = fmt.Sprintf("module = '%s' and %s", moduleName, cond) + if len(mlist) == 2 { + mlist = append(mlist, "") + } + if mquery, ok := mquerys[mtable]; ok { mquery.ModuleQuery[strings.Join(mlist[2:], ",")] = struct{}{} } else { mquery := &ModuleQuery{ TableName: tname, - ModuleName: mtable, + ModuleName: mtable + "." + moduleName, ModuleQuery: map[string]struct{}{strings.Join(mlist[2:], ","): {}}} mquerys[mtable] = mquery } @@ -139,7 +144,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r var querydata map[string]any = make(map[string]any) err = json.Unmarshal([]byte(info["querydata"].(string)), &querydata) if err != nil { - logx.Error(err) + logx.Error(err, info) return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error()) }