1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-23 19:30:55 +00:00
This commit is contained in:
Ming Deng 2020-11-10 23:30:24 +08:00
parent 2a6fadb9ae
commit 0b3bcbd3ec

View File

@ -76,10 +76,13 @@ func (c Condition) AndNot(expr string, args ...interface{}) *Condition {
// AndCond combine a condition to current condition // AndCond combine a condition to current condition
func (c *Condition) AndCond(cond *Condition) *Condition { func (c *Condition) AndCond(cond *Condition) *Condition {
c = c.clone()
if c == cond { if c == cond {
panic(fmt.Errorf("<Condition.AndCond> cannot use self as sub cond")) panic(fmt.Errorf("<Condition.AndCond> cannot use self as sub cond"))
} }
c = c.clone()
if cond != nil { if cond != nil {
c.params = append(c.params, condValue{cond: cond, isCond: true}) c.params = append(c.params, condValue{cond: cond, isCond: true})
} }