mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 03:33:53 +08:00
fix 修复树表生成选项
This commit is contained in:
@@ -179,7 +179,11 @@ func GenTypeSelect(ctx context.Context) (res sysin.GenTypeSelects, err error) {
|
||||
Templates: make(sysin.GenTemplateSelects, 0),
|
||||
}
|
||||
|
||||
confName, ok := consts.GenCodesTypeConfMap[k]
|
||||
km := k
|
||||
if km == consts.GenCodesTypeTree {
|
||||
km = consts.GenCodesTypeCurd
|
||||
}
|
||||
confName, ok := consts.GenCodesTypeConfMap[km]
|
||||
if ok {
|
||||
var temps []*model.GenerateAppCrudTemplate
|
||||
err = g.Cfg().MustGet(ctx, "hggen.application."+confName+".templates").Scan(&temps)
|
||||
|
||||
@@ -286,7 +286,7 @@ func (l *gCurd) generateLogicListWhereEach(buffer *bytes.Buffer, in *CurdPreview
|
||||
case WhereModeNotLike:
|
||||
whereTag = "\tif " + linkMode + " {\n\t\tmod = mod." + wherePrefix + "NotLike(" + tablePrefix + "dao." + daoName + ".Columns()." + columnName + ", in." + field.GoName + ")\n\t}"
|
||||
case WhereModeJsonContains:
|
||||
val := tablePrefix + "fmt.Sprintf(`JSON_CONTAINS(%s,'%v')`, dao." + daoName + ".Columns()." + columnName + ", in." + field.GoName + ")"
|
||||
val := tablePrefix + `"JSON_CONTAINS("+dao.` + daoName + `.Columns().` + columnName + `+",?)", in.` + field.GoName
|
||||
whereTag = "\tif " + linkMode + " {\n\t\tmod = mod." + wherePrefix + "(" + val + ")\n\t}"
|
||||
|
||||
default:
|
||||
|
||||
@@ -177,8 +177,14 @@ func (s *sSysGenCodes) List(ctx context.Context, in *sysin.GenCodesListInp) (lis
|
||||
if row == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
genType := int(row.GenType)
|
||||
if genType == consts.GenCodesTypeTree {
|
||||
genType = consts.GenCodesTypeCurd
|
||||
}
|
||||
|
||||
for _, v := range typeSelect {
|
||||
if v.Value == int(row.GenType) {
|
||||
if v.Value == genType {
|
||||
for index, template := range v.Templates {
|
||||
if index == row.GenTemplate {
|
||||
return template.Label
|
||||
@@ -186,7 +192,6 @@ func (s *sSysGenCodes) List(ctx context.Context, in *sysin.GenCodesListInp) (lis
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user