fix: AND条件没传参数
This commit is contained in:
parent
499cc8c60d
commit
e51164eb53
@ -2,11 +2,12 @@ package lxDb
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitea.listensoft.net/tool/lxutils/lxUtil"
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"gitea.listensoft.net/tool/lxutils/lxUtil"
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BaseModel struct {
|
type BaseModel struct {
|
||||||
@ -187,7 +188,7 @@ func (q *PaginationQuery) Build(tx *gorm.DB) *gorm.DB {
|
|||||||
field := fmt.Sprintf("%s = ?", con.Field)
|
field := fmt.Sprintf("%s = ?", con.Field)
|
||||||
tx = tx.Or(field, con.Arg)
|
tx = tx.Or(field, con.Arg)
|
||||||
case "and":
|
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":
|
case "group":
|
||||||
tx = tx.Group(con.Field)
|
tx = tx.Group(con.Field)
|
||||||
case "join":
|
case "join":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user