fix
This commit is contained in:
parent
8337900423
commit
6245387899
|
@ -49,6 +49,7 @@ type InfoType struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ModuleQuery struct {
|
type ModuleQuery struct {
|
||||||
|
TableName string
|
||||||
ModuleName string
|
ModuleName string
|
||||||
ModuleQuery map[string]struct{}
|
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{}{}
|
mquery.ModuleQuery[strings.Join(mlist[1:], ",")] = struct{}{}
|
||||||
} else {
|
} else {
|
||||||
mquery := &ModuleQuery{
|
mquery := &ModuleQuery{
|
||||||
|
TableName: mtable,
|
||||||
ModuleName: mtable,
|
ModuleName: mtable,
|
||||||
ModuleQuery: map[string]struct{}{strings.Join(mlist[1:], ","): {}}}
|
ModuleQuery: map[string]struct{}{strings.Join(mlist[1:], ","): {}}}
|
||||||
mquerys[mtable] = mquery
|
mquerys[mtable] = mquery
|
||||||
|
@ -113,7 +115,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r
|
||||||
|
|
||||||
for _, mquery := range mquerys {
|
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
|
var info InfoType
|
||||||
err := l.svcCtx.MysqlConn.Raw(sqlstr).Scan(&info).Error
|
err := l.svcCtx.MysqlConn.Raw(sqlstr).Scan(&info).Error
|
||||||
if err == gorm.ErrRecordNotFound {
|
if err == gorm.ErrRecordNotFound {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user