fix issue of OmitEmptyWhere in Builder for package gdb (#2195)

This commit is contained in:
John Guo
2022-10-12 20:30:47 +08:00
committed by GitHub
parent 35623b5abe
commit 4ebe4233fc
2 changed files with 24 additions and 1 deletions

View File

@ -116,7 +116,7 @@ func (b *WhereBuilder) convertWhereBuilder(where interface{}, args []interface{}
}
if builder != nil {
conditionWhere, conditionArgs := builder.Build()
if len(b.whereHolder) == 0 {
if conditionWhere != "" && len(b.whereHolder) == 0 {
conditionWhere = "(" + conditionWhere + ")"
}
return conditionWhere, conditionArgs