修复where条件丢失问题
This commit is contained in:
parent
e0b984e2cf
commit
4e1b8ea8fb
4
base.go
4
base.go
@ -240,6 +240,10 @@ func (b *BaseDao) setTxCondition(tx *gorm.DB, optionFuncList ...define.SetOption
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(o.Where) > 0 {
|
||||||
|
tx = tx.Where(o.Where)
|
||||||
|
}
|
||||||
|
|
||||||
// between
|
// between
|
||||||
for field, betweenVal := range o.Between {
|
for field, betweenVal := range o.Between {
|
||||||
tx = tx.Where("`"+field+"` BETWEEN ? AND ?", betweenVal[0], betweenVal[1])
|
tx = tx.Where("`"+field+"` BETWEEN ? AND ?", betweenVal[0], betweenVal[1])
|
||||||
|
Loading…
Reference in New Issue
Block a user