修复bug
This commit is contained in:
parent
c420e23edb
commit
524a892480
@ -836,9 +836,17 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db *
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
reStr += table + "." + v.GetString("name") + ","
|
reStr += table + "." + v.GetString("name") + ","
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v["name"] == "parent_id" && v.GetString("link") != "" {
|
||||||
|
leftJoin["[>]"+v.GetString("link")+" selfParent"] =
|
||||||
|
"selfParent.id=" +
|
||||||
|
v.GetString("link") + "." + v.GetString("name")
|
||||||
|
reStr += "selfParent." + v.GetString("value") + " AS " + v.GetString("link") + "_" + v.GetString("name") + "_" + v.GetString("value") + ","
|
||||||
|
}
|
||||||
|
|
||||||
//准备加入索引权限
|
//准备加入索引权限
|
||||||
if v.GetString("link") != "" &&
|
if v.GetString("link") != "" &&
|
||||||
userData != nil &&
|
userData != nil &&
|
||||||
|
@ -634,15 +634,42 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map {
|
|||||||
v := testQuData[k]
|
v := testQuData[k]
|
||||||
switch Substr(k, 0, 3) {
|
switch Substr(k, 0, 3) {
|
||||||
case "[>]":
|
case "[>]":
|
||||||
query += " LEFT JOIN `" + Substr(k, 3, len(k)-3) + "` ON " + v.(string) + " "
|
func() {
|
||||||
|
table := Substr(k, 3, len(k)-3)
|
||||||
|
if !strings.Contains(table, " ") {
|
||||||
|
table = "`" + table + "`"
|
||||||
|
}
|
||||||
|
query += " LEFT JOIN " + table + " ON " + v.(string) + " "
|
||||||
|
}()
|
||||||
case "[<]":
|
case "[<]":
|
||||||
query += " RIGHT JOIN `" + Substr(k, 3, len(k)-3) + "` ON " + v.(string) + " "
|
func() {
|
||||||
|
table := Substr(k, 3, len(k)-3)
|
||||||
|
if !strings.Contains(table, " ") {
|
||||||
|
table = "`" + table + "`"
|
||||||
|
}
|
||||||
|
query += " RIGHT JOIN " + table + " ON " + v.(string) + " "
|
||||||
|
}()
|
||||||
|
|
||||||
}
|
}
|
||||||
switch Substr(k, 0, 4) {
|
switch Substr(k, 0, 4) {
|
||||||
case "[<>]":
|
case "[<>]":
|
||||||
query += " FULL JOIN `" + Substr(k, 4, len(k)-4) + "` ON " + v.(string) + " "
|
func() {
|
||||||
|
table := Substr(k, 4, len(k)-4)
|
||||||
|
if !strings.Contains(table, " ") {
|
||||||
|
table = "`" + table + "`"
|
||||||
|
}
|
||||||
|
query += " FULL JOIN " + table + " ON " + v.(string) + " "
|
||||||
|
}()
|
||||||
|
|
||||||
case "[><]":
|
case "[><]":
|
||||||
query += " INNER JOIN `" + Substr(k, 4, len(k)-4) + "` ON " + v.(string) + " "
|
func() {
|
||||||
|
table := Substr(k, 4, len(k)-4)
|
||||||
|
if !strings.Contains(table, " ") {
|
||||||
|
table = "`" + table + "`"
|
||||||
|
}
|
||||||
|
query += " INNER JOIN " + table + " ON " + v.(string) + " "
|
||||||
|
}()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user