Browse Source

查询增加主从判断逻辑

master v0.10.0
guzeng 2 years ago
parent
commit
ff798de0a6
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      chain.go

+ 4
- 1
chain.go View File

@ -351,7 +351,10 @@ func (this *Query) QueryStmt() error {
return err return err
} }
sql := helper.ToStr(res["sql"]) sql := helper.ToStr(res["sql"])
if this.conn == nil {
if SLAVER_DB != nil {
this.conn = SLAVER_DB
} else {
this.conn = DB this.conn = DB
} }


Loading…
Cancel
Save