From ef837bd9c6ee12309251d22165b108a9ed3c7c43 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 22 Jul 2019 23:51:47 +0800 Subject: [PATCH] add quotes for tx for gdb --- g/database/gdb/gdb_transaction.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g/database/gdb/gdb_transaction.go b/g/database/gdb/gdb_transaction.go index b91cac7c5..5cd896469 100644 --- a/g/database/gdb/gdb_transaction.go +++ b/g/database/gdb/gdb_transaction.go @@ -165,7 +165,7 @@ func (tx *TX) BatchSave(table string, list interface{}, batch ...int) (sql.Resul // CURD操作:数据更新,统一采用sql预处理, // data参数支持字符串或者关联数组类型,内部会自行做判断处理. func (tx *TX) Update(table string, data interface{}, condition interface{}, args ...interface{}) (sql.Result, error) { - newWhere, newArgs := formatWhere(condition, args) + newWhere, newArgs := tx.db.formatWhere(condition, args) if newWhere != "" { newWhere = " WHERE " + newWhere } @@ -179,7 +179,7 @@ func (tx *TX) doUpdate(table string, data interface{}, condition string, args .. // CURD操作:删除数据 func (tx *TX) Delete(table string, condition interface{}, args ...interface{}) (sql.Result, error) { - newWhere, newArgs := formatWhere(condition, args) + newWhere, newArgs := tx.db.formatWhere(condition, args) if newWhere != "" { newWhere = " WHERE " + newWhere }