fix: generate sql incorrect when use soft_delete and only one OR

This commit is contained in:
longlihale 2021-12-30 11:36:59 +08:00
parent d69be45dd2
commit 8846f34747

View File

@ -94,10 +94,14 @@ func And(exprs ...Expression) Expression {
return nil
}
if _, ok := exprs[0].(OrConditions); !ok && len(exprs) == 1 {
if len(exprs) == 1 {
if _, ok := exprs[0].(OrConditions); !ok {
return exprs[0]
}
}
return AndConditions{Exprs: exprs}
}