数据库操作bug

This commit is contained in:
hoteas 2022-08-31 11:14:45 +08:00
parent fd6b15bdaf
commit 7b502fed36
1 changed files with 12 additions and 3 deletions

View File

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