数据库操作优化
This commit is contained in:
parent
432d59d483
commit
125ccc5c3b
@ -534,7 +534,7 @@ func (that *HoTimeDB) md5(query string, args ...interface{}) string {
|
|||||||
|
|
||||||
func (that *HoTimeDB) Query(query string, args ...interface{}) []Map {
|
func (that *HoTimeDB) Query(query string, args ...interface{}) []Map {
|
||||||
defer func() {
|
defer func() {
|
||||||
if that.Mode == 2 {
|
if that.Mode != 0 {
|
||||||
that.Log.Info("SQL:"+that.LastQuery, " DATA:", that.LastData, " ERROR:", that.LastErr.GetError())
|
that.Log.Info("SQL:"+that.LastQuery, " DATA:", that.LastData, " ERROR:", that.LastErr.GetError())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@ -582,7 +582,7 @@ func (that *HoTimeDB) Query(query string, args ...interface{}) []Map {
|
|||||||
|
|
||||||
func (that *HoTimeDB) Exec(query string, args ...interface{}) (sql.Result, *Error) {
|
func (that *HoTimeDB) Exec(query string, args ...interface{}) (sql.Result, *Error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if that.Mode == 2 {
|
if that.Mode != 0 {
|
||||||
that.Log.Info("SQL: "+that.LastQuery, " DATA: ", that.LastData, " ERROR: ", that.LastErr.GetError())
|
that.Log.Info("SQL: "+that.LastQuery, " DATA: ", that.LastData, " ERROR: ", that.LastErr.GetError())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user