修复bug
This commit is contained in:
@@ -189,7 +189,7 @@ func GenFListIndex(info FList, status int) string {
|
||||
{
|
||||
var strs []string
|
||||
for _, v := range info.Kem {
|
||||
strs = append(strs, fmt.Sprintf("`%v` = ?", v.ColName))
|
||||
strs = append(strs, fmt.Sprintf("%v = ?", v.ColName)) //wxw 2021.2.26 16:53
|
||||
}
|
||||
return strings.Join(strs, " AND ")
|
||||
}
|
||||
|
||||
@@ -254,10 +254,15 @@ func (m *_Model) generateFunc() (genOut []GenOutInfo) {
|
||||
pkg.AddImport(`"context"`) // 添加import信息
|
||||
pkg.AddImport(cnf.EImportsHead["gorm.Model"])
|
||||
|
||||
data := funDef{
|
||||
StructName: getCamelName(tab.Name),
|
||||
TableName: tab.Name,
|
||||
// wxw 2021.2.26 17:17
|
||||
var data funDef
|
||||
data.TableName = tab.Name
|
||||
tablePrefix := config.GetTablePrefix()
|
||||
//如果设置了表前缀
|
||||
if tablePrefix != "" {
|
||||
tab.Name = strings.TrimLeft(tab.Name, tablePrefix)
|
||||
}
|
||||
data.StructName = getCamelName(tab.Name)
|
||||
|
||||
var primary, unique, uniqueIndex, index []FList
|
||||
for _, el := range tab.Em {
|
||||
|
||||
Reference in New Issue
Block a user