diff --git a/db/hotimedb.go b/db/hotimedb.go index c93eb61..442e36d 100644 --- a/db/hotimedb.go +++ b/db/hotimedb.go @@ -460,15 +460,15 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map { v := testQuData[k] switch Substr(k, 0, 3) { case "[>]": - query += " LEFT JOIN " + Substr(k, 3, len(k)-3) + " ON " + v.(string) + query += " LEFT JOIN `" + Substr(k, 3, len(k)-3) + "` ON " + v.(string) case "[<]": - query += " RIGHT JOIN " + Substr(k, 3, len(k)-3) + " ON " + v.(string) + query += " RIGHT JOIN `" + Substr(k, 3, len(k)-3) + "` ON " + v.(string) } switch Substr(k, 0, 4) { case "[<>]": - query += " FULL JOIN " + Substr(k, 4, len(k)-4) + " ON " + v.(string) + query += " FULL JOIN `" + Substr(k, 4, len(k)-4) + "` ON " + v.(string) case "[><]": - query += " INNER JOIN " + Substr(k, 4, len(k)-4) + " ON " + v.(string) + query += " INNER JOIN `" + Substr(k, 4, len(k)-4) + "` ON " + v.(string) } } } diff --git a/example/app/declare.go b/example/app/declare.go index d151ee5..2382d5f 100644 --- a/example/app/declare.go +++ b/example/app/declare.go @@ -139,7 +139,7 @@ var DeclareCtr = Ctr{ //标签分析 if tags != nil { for _, v := range tags { - dtag := that.Db.Select("declare_tag", Map{"[><]`declare`": "declare_tag.declare_id=declare.id"}, "declare_tag.declare_id", Map{"AND": Map{"OR": Map{"declare.policy_level": Slice{"省", "市"}, "declare.dispatch_department[~]": qu}, "declare_tag.tag_id": v}}) + dtag := that.Db.Select("declare_tag", Map{"[><]declare": "declare_tag.declare_id=declare.id"}, "declare_tag.declare_id", Map{"AND": Map{"OR": Map{"declare.policy_level": Slice{"省", "市"}, "declare.dispatch_department[~]": qu}, "declare_tag.tag_id": v}}) for _, v1 := range dtag { if declares[v1.GetCeilInt64("declare_id")] == nil { declares[v1.GetCeilInt64("declare_id")] = v1