Browse Source

添加子查询

master
zhenghaorong 2 years ago
parent
commit
f90aec27a3
2 changed files with 12 additions and 4 deletions
  1. +6
    -2
      chain.go
  2. +6
    -2
      transaction_chain.go

+ 6
- 2
chain.go View File

@ -159,8 +159,12 @@ func (this *Query) BuildSelectSql() (map[string]interface{}, error) {
if this.dbname == "" && this.table == "" {
return nil, errors.New("参数错误,没有数据表")
}
table := getTableName(this.dbname, this.table, this.dbtype)
var table = ""
if strings.Contains(this.table, "select ") {
table = this.table
} else {
table = getTableName(this.dbname, this.table, this.dbtype)
}
// var err error


+ 6
- 2
transaction_chain.go View File

@ -160,8 +160,12 @@ func (this *TxQuery) BuildSelectSql() (map[string]interface{}, error) {
if this.dbname == "" && this.table == "" {
return nil, errors.New("参数错误,没有数据表")
}
table := getTableName(this.dbname, this.table)
var table = ""
if strings.Contains(this.table, "select ") {
table = this.table
} else {
table = getTableName(this.dbname, this.table)
}
var sql, title string


Loading…
Cancel
Save