fix: AND条件没传参数

This commit is contained in:
Sans 2026-03-19 18:43:20 +08:00
parent 499cc8c60d
commit e51164eb53

View File

@ -2,11 +2,12 @@ package lxDb
import (
"fmt"
"gitea.listensoft.net/tool/lxutils/lxUtil"
"gorm.io/gorm"
"reflect"
"strings"
"time"
"gitea.listensoft.net/tool/lxutils/lxUtil"
"gorm.io/gorm"
)
type BaseModel struct {
@ -187,7 +188,7 @@ func (q *PaginationQuery) Build(tx *gorm.DB) *gorm.DB {
field := fmt.Sprintf("%s = ?", con.Field)
tx = tx.Or(field, con.Arg)
case "and":
tx = tx.Where(con.Field) // 自定义条件, 如: (length(field) = 4 OR length(field) = 6)
tx = tx.Where(con.Field, con.Args...) // 自定义条件, 如: (length(field) = 4 OR length(field) = 6)
case "group":
tx = tx.Group(con.Field)
case "join":