From 6d9af149adc93b849c80f03836a990f2c6308c11 Mon Sep 17 00:00:00 2001 From: hoteas Date: Thu, 18 Aug 2022 13:40:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/hotimedb.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db/hotimedb.go b/db/hotimedb.go index fa86736..b004d89 100644 --- a/db/hotimedb.go +++ b/db/hotimedb.go @@ -81,7 +81,7 @@ func (that *HotimeDBBuilder) Update(qu ...interface{}) int64 { } if lth > 1 { for k := 1; k < lth; k++ { - data[ObjToStr(k-1)] = qu[k] + data[ObjToStr(qu[k-1])] = qu[k] k++ } } @@ -126,7 +126,7 @@ func (that *HotimeDBBuilder) Join(qu ...interface{}) *HotimeDBBuilder { } if lth > 1 { for k := 1; k < lth; k++ { - data[ObjToStr(k-1)] = qu[k] + data[ObjToStr(qu[k-1])] = qu[k] k++ } } @@ -155,7 +155,7 @@ func (that *HotimeDBBuilder) And(qu ...interface{}) *HotimeDBBuilder { if lth > 1 { where = Map{} for k := 1; k < lth; k++ { - where[ObjToStr(k-1)] = qu[k] + where[ObjToStr(qu[k-1])] = qu[k] k++ } } @@ -187,7 +187,7 @@ func (that *HotimeDBBuilder) Or(qu ...interface{}) *HotimeDBBuilder { if lth > 1 { where = Map{} for k := 1; k < lth; k++ { - where[ObjToStr(k-1)] = qu[k] + where[ObjToStr(qu[k-1])] = qu[k] k++ } } @@ -218,7 +218,7 @@ func (that *HotimeDBBuilder) Where(qu ...interface{}) *HotimeDBBuilder { if lth > 1 { where = Map{} for k := 1; k < lth; k++ { - where[ObjToStr(k-1)] = qu[k] + where[ObjToStr(qu[k-1])] = qu[k] k++ } } @@ -703,9 +703,9 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map { } if reflect.ValueOf(qu[0]).Type().String() == "common.Slice" { - - for key, _ := range testQuData { - v := testQuData.GetMap(key) + qu0 := ObjToSlice(qu[0]) + for key, _ := range qu0 { + v := qu0.GetMap(key) for k1, v1 := range v { testQu = append(testQu, k1) testQuData[k1] = v1