@@ -52,7 +52,7 @@ func GetTablePrefixName(name string) string { //
|
|||||||
tablePrefix := config.GetTablePrefix()
|
tablePrefix := config.GetTablePrefix()
|
||||||
//如果设置了表前缀
|
//如果设置了表前缀
|
||||||
if tablePrefix != "" {
|
if tablePrefix != "" {
|
||||||
return fmt.Sprintf("%v.%v", tablePrefix, name)
|
name = tablePrefix + name
|
||||||
}
|
}
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
|||||||
@@ -98,7 +98,9 @@ func (m *cnfModel) GetPkgName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(pkgName) == 0 || pkgName == "." {
|
if len(pkgName) == 0 || pkgName == "." {
|
||||||
list = strings.Split(tools.GetModelPath(), "/")
|
curDir := tools.GetModelPath()
|
||||||
|
curDir = strings.Replace(curDir, "\\", "/", -1)
|
||||||
|
list = strings.Split(curDir, "/")
|
||||||
if len(list) > 0 {
|
if len(list) > 0 {
|
||||||
pkgName = list[len(list)-1]
|
pkgName = list[len(list)-1]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ func (m *_Model) GetPackage() genstruct.GenPackage {
|
|||||||
var pkg genstruct.GenPackage
|
var pkg genstruct.GenPackage
|
||||||
pkg.SetPackage(m.info.PackageName) //package name
|
pkg.SetPackage(m.info.PackageName) //package name
|
||||||
|
|
||||||
// tablePrefix := config.GetTablePrefix()
|
tablePrefix := config.GetTablePrefix()
|
||||||
|
|
||||||
for _, tab := range m.info.TabList {
|
for _, tab := range m.info.TabList {
|
||||||
var sct genstruct.GenStruct
|
var sct genstruct.GenStruct
|
||||||
|
|
||||||
sct.SetTableName(tab.Name)
|
sct.SetTableName(tablePrefix + tab.Name)
|
||||||
|
|
||||||
//如果设置了表前缀
|
//如果设置了表前缀
|
||||||
// if tablePrefix != "" {
|
// if tablePrefix != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user