fix
This commit is contained in:
parent
1bd70a19e7
commit
8756acb3b1
|
@ -52,7 +52,10 @@ func (mquery *ModuleQuery) EncodeQuery(field string) string {
|
||||||
var qstr []byte = []byte("JSON_OBJECT(")
|
var qstr []byte = []byte("JSON_OBJECT(")
|
||||||
|
|
||||||
for query := range mquery.ModuleQuery {
|
for query := range mquery.ModuleQuery {
|
||||||
qstr = append(qstr, []byte(fmt.Sprintf("'%s.%s',%s ->> '$.%s',", mquery.ModuleName, query, field, query))...)
|
if query != "" {
|
||||||
|
query = "." + query
|
||||||
|
}
|
||||||
|
qstr = append(qstr, []byte(fmt.Sprintf("'%s.%s',%s ->> '$%s',", mquery.ModuleName, "."+query, field, query))...)
|
||||||
}
|
}
|
||||||
if qstr[len(qstr)-1] == ',' {
|
if qstr[len(qstr)-1] == ',' {
|
||||||
qstr[len(qstr)-1] = ')'
|
qstr[len(qstr)-1] = ')'
|
||||||
|
@ -100,7 +103,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r
|
||||||
cond = fmt.Sprintf("module = '%s' and %s", moduleName, cond)
|
cond = fmt.Sprintf("module = '%s' and %s", moduleName, cond)
|
||||||
|
|
||||||
if len(mlist) == 2 {
|
if len(mlist) == 2 {
|
||||||
mlist = append(mlist, "*")
|
mlist = append(mlist, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if mquery, ok := mquerys[mtable]; ok {
|
if mquery, ok := mquerys[mtable]; ok {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user