fix: 修正 JSONB 字段查询变量名
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-23 00:21:22 +08:00
committed by cnb
parent b51d682646
commit 6c0c6cafff

View File

@@ -352,8 +352,8 @@ func (s *Service) ServicePage(ctx context.Context, req *PageReq) (data interface
}
// 2. JSONB data->>'xxx' 字段查询(你要的 data 类查找)
if len(s.ListQueryOp.DataFieldEQ) > 0 {
for _, field := range s.ListQueryOp.DataFieldEQ {
if len(s.PageQueryOp.DataFieldEQ) > 0 {
for _, field := range s.PageQueryOp.DataFieldEQ {
if val := r.Get(field); val.String() != "" {
// 关键:拼接 data->>'字段名' = ?
m.Where("data->>? = ?", field, val)