修复where条件丢失问题

This commit is contained in:
白茶清欢 2024-08-24 13:23:37 +08:00
parent e0b984e2cf
commit 4e1b8ea8fb

View File

@ -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
for field, betweenVal := range o.Between {
tx = tx.Where("`"+field+"` BETWEEN ? AND ?", betweenVal[0], betweenVal[1])