fix: 修正 JSONB 字段查询变量名
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -352,8 +352,8 @@ func (s *Service) ServicePage(ctx context.Context, req *PageReq) (data interface
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. JSONB data->>'xxx' 字段查询(你要的 data 类查找)
|
// 2. JSONB data->>'xxx' 字段查询(你要的 data 类查找)
|
||||||
if len(s.ListQueryOp.DataFieldEQ) > 0 {
|
if len(s.PageQueryOp.DataFieldEQ) > 0 {
|
||||||
for _, field := range s.ListQueryOp.DataFieldEQ {
|
for _, field := range s.PageQueryOp.DataFieldEQ {
|
||||||
if val := r.Get(field); val.String() != "" {
|
if val := r.Get(field); val.String() != "" {
|
||||||
// 关键:拼接 data->>'字段名' = ?
|
// 关键:拼接 data->>'字段名' = ?
|
||||||
m.Where("data->>? = ?", field, val)
|
m.Where("data->>? = ?", field, val)
|
||||||
|
|||||||
Reference in New Issue
Block a user