Browse Source

Merge branch 'master' of ssh://git.tetele.net:4001/tgo/dbquery

master v0.11.3
guzeng 1 year ago
parent
commit
2a1e8837ad
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      db.go

+ 6
- 2
db.go View File

@ -332,7 +332,9 @@ func GetRow(dbName, table_name, alias string, titles string, join [][]string, wh
if len(joinitem) < 2 {
continue
}
if len(joinitem) == 3 {
if len(joinitem) == 4 {
sql_str = helper.StringJoin(sql_str, " ", joinitem[2], " join ", joinitem[0], " on ", joinitem[1])
} else if len(joinitem) == 3 {
sql_str = helper.StringJoin(sql_str, " ", joinitem[2], " join ", getTableName(dbName, joinitem[0]), " on ", joinitem[1])
} else { //默认左连接
sql_str = helper.StringJoin(sql_str, " left join ", getTableName(dbName, joinitem[0]), " on ", joinitem[1])
@ -482,7 +484,9 @@ func FetchRows(dbName, table_name, alias string, titles string, join [][]string,
if len(joinitem) < 2 {
continue
}
if len(joinitem) == 3 {
if len(joinitem) == 4 {
sql_str = helper.StringJoin(sql_str, " ", joinitem[2], " join ", joinitem[0], " on ", joinitem[1])
} else if len(joinitem) == 3 {
sql_str = helper.StringJoin(sql_str, " ", joinitem[2], " join ", getTableName(dbName, joinitem[0]), " on ", joinitem[1])
} else { //默认左连接
sql_str = helper.StringJoin(sql_str, " left join ", getTableName(dbName, joinitem[0]), " on ", joinitem[1])


Loading…
Cancel
Save