From 7b502fed36d656201369bb249d56611cd6186c65 Mon Sep 17 00:00:00 2001 From: hoteas Date: Wed, 31 Aug 2022 11:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=93=8D=E4=BD=9Cbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/hotimedb.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/db/hotimedb.go b/db/hotimedb.go index b004d89..71cdcd3 100644 --- a/db/hotimedb.go +++ b/db/hotimedb.go @@ -165,8 +165,11 @@ func (that *HotimeDBBuilder) And(qu ...interface{}) *HotimeDBBuilder { } if that.lastWhere != nil { + if that.lastWhere["AND"] != nil { + where["AND"] = that.lastWhere["AND"] + } that.lastWhere["AND"] = where - that.lastWhere = where + //that.lastWhere = where return that } that.lastWhere = where @@ -196,8 +199,11 @@ func (that *HotimeDBBuilder) Or(qu ...interface{}) *HotimeDBBuilder { } if that.lastWhere != nil { + if that.lastWhere["OR"] != nil { + where["OR"] = that.lastWhere["OR"] + } that.lastWhere["OR"] = where - that.lastWhere = where + //that.lastWhere = where return that } that.lastWhere = where @@ -228,8 +234,11 @@ func (that *HotimeDBBuilder) Where(qu ...interface{}) *HotimeDBBuilder { } if that.lastWhere != nil { + if that.lastWhere["AND"] != nil { + where["AND"] = that.lastWhere["AND"] + } that.lastWhere["AND"] = where - that.lastWhere = where + //that.lastWhere = where return that } that.lastWhere = where