结构调整添加cmd
This commit is contained in:
1 parent
f2829bfd98
commit
a2f4c00246
72 files changed
+838
-597
No files matched your search
@@ -2,8 +2,8 @@ package tools
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"go-admin/config"
|
||||
orm "go-admin/database"
|
||||
config2 "go-admin/tools/config"
|
||||
)
|
||||
|
||||
type DBColumns struct {
|
||||
@@ -25,7 +25,7 @@ func (e *DBColumns) GetPage(pageSize int, pageIndex int) ([]DBColumns, int, erro
|
||||
var doc []DBColumns
|
||||
|
||||
table := orm.Eloquent.Select("*").Table("information_schema.`COLUMNS`")
|
||||
table = table.Where("table_schema= ? ", config.DatabaseConfig.Database)
|
||||
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
|
||||
|
||||
if e.TableName != "" {
|
||||
return nil, 0, errors.New("table name cannot be empty!")
|
||||
@@ -46,7 +46,7 @@ func (e *DBColumns) GetList() ([]DBColumns, error) {
|
||||
var doc []DBColumns
|
||||
|
||||
table := orm.Eloquent.Select("*").Table("information_schema.columns")
|
||||
table = table.Where("table_schema= ? ", config.DatabaseConfig.Database)
|
||||
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
|
||||
|
||||
if e.TableName == "" {
|
||||
return nil, errors.New("table name cannot be empty!")
|
||||
|
||||
@@ -2,8 +2,8 @@ package tools
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"go-admin/config"
|
||||
orm "go-admin/database"
|
||||
config2 "go-admin/tools/config"
|
||||
)
|
||||
|
||||
type DBTables struct {
|
||||
@@ -20,7 +20,7 @@ func (e *DBTables) GetPage(pageSize int, pageIndex int) ([]DBTables, int, error)
|
||||
var doc []DBTables
|
||||
|
||||
table := orm.Eloquent.Select("*").Table("information_schema.tables")
|
||||
table = table.Where("table_schema= ? ", config.DatabaseConfig.Database)
|
||||
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
|
||||
|
||||
if e.TableName != "" {
|
||||
table = table.Where("TABLE_NAME = ?", e.TableName)
|
||||
@@ -39,7 +39,7 @@ func (e *DBTables) Get() (DBTables, error) {
|
||||
var doc DBTables
|
||||
|
||||
table := orm.Eloquent.Select("*").Table("information_schema.tables")
|
||||
table = table.Where("table_schema= ? ", config.DatabaseConfig.Database)
|
||||
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
|
||||
if e.TableName == "" {
|
||||
return doc, errors.New("table name cannot be empty!")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user