mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-11 20:43:44 +08:00
fix 代码生成switch
This commit is contained in:
@@ -232,6 +232,15 @@ func HasColumn(masterFields []*sysin.GenCodesColumnListModel, column string) boo
|
||||
return false
|
||||
}
|
||||
|
||||
func HasColumnWithFormMode(masterFields []*sysin.GenCodesColumnListModel, column string) bool {
|
||||
for _, field := range masterFields {
|
||||
if field.FormMode == column {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func HasMaxSort(masterFields []*sysin.GenCodesColumnListModel) bool {
|
||||
return HasColumn(masterFields, "Sort")
|
||||
}
|
||||
@@ -247,5 +256,5 @@ func HasSwitch(headOps []string, masterFields []*sysin.GenCodesColumnListModel)
|
||||
if !gstr.InArray(headOps, "switch") {
|
||||
return false
|
||||
}
|
||||
return HasColumn(masterFields, "Switch")
|
||||
return HasColumnWithFormMode(masterFields, "Switch")
|
||||
}
|
||||
|
Reference in New Issue
Block a user