[fix] 条件分支为空时, 构建sql错误
This commit is contained in:
parent
2a97e48523
commit
32031a7f53
@ -11,6 +11,10 @@ type EngineCase[T any] struct {
|
||||
}
|
||||
|
||||
func (this EngineCase[T]) ToSql(param contracts.ModelParam) db.Expression {
|
||||
if this.predicate == nil || this.predicate.IsEmpty() {
|
||||
return db.Raw("NULL")
|
||||
}
|
||||
|
||||
return this.predicate.ToSql(param)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user