add quotes for tx for gdb

This commit is contained in:
John
2019-07-22 23:51:47 +08:00
parent 6a76725d64
commit ef837bd9c6

View File

@ -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
}