|
|
@ -354,6 +354,7 @@ func GetRow(dbName, table_name, alias string, titles string, with, join [][]stri |
|
|
|
if len(join) > 0 { |
|
|
|
var builder strings.Builder |
|
|
|
builder.WriteString(sql_str) |
|
|
|
boo := false |
|
|
|
for _, joinitem := range join { |
|
|
|
if len(joinitem) < 2 { |
|
|
|
continue |
|
|
@ -372,8 +373,9 @@ func GetRow(dbName, table_name, alias string, titles string, with, join [][]stri |
|
|
|
} |
|
|
|
builder.WriteString(" on ") |
|
|
|
builder.WriteString(joinitem[1]) |
|
|
|
boo = true |
|
|
|
} |
|
|
|
if builder.Len() > 0 { |
|
|
|
if boo { |
|
|
|
sql_str = builder.String() |
|
|
|
} |
|
|
|
} |
|
|
@ -544,11 +546,11 @@ func FetchRows(dbName, table_name, alias string, titles string, with, join [][]s |
|
|
|
if len(join) > 0 { |
|
|
|
var builder strings.Builder |
|
|
|
builder.WriteString(sql_str) |
|
|
|
boo := false |
|
|
|
for _, joinitem := range join { |
|
|
|
if len(joinitem) < 2 { |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
builder.WriteString(" ") |
|
|
|
if len(joinitem) >= 3 { |
|
|
|
builder.WriteString(joinitem[2]) |
|
|
@ -563,8 +565,9 @@ func FetchRows(dbName, table_name, alias string, titles string, with, join [][]s |
|
|
|
} |
|
|
|
builder.WriteString(" on ") |
|
|
|
builder.WriteString(joinitem[1]) |
|
|
|
boo = true |
|
|
|
} |
|
|
|
if builder.Len() > 0 { |
|
|
|
if boo { |
|
|
|
sql_str = builder.String() |
|
|
|
} |
|
|
|
} |
|
|
|