From 2bdda7558c7ffffe424ad4db3e61257ca8135745 Mon Sep 17 00:00:00 2001 From: shanshanzhong Date: Fri, 27 Mar 2026 07:22:39 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20JSON=5FCONTAINS=20node=5Fgroup=5Fids=20?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=9C=80=E7=94=A8=E5=BC=95=E5=8F=B7=E5=8C=85?= =?UTF-8?q?=E8=A3=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JSON_CONTAINS 第二参数必须是 JSON 字符串,裸数字会报 Error 3146。 修复:%d → '%d' Co-Authored-By: claude-flow --- internal/model/node/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/model/node/model.go b/internal/model/node/model.go index eb250bb..e6961c1 100644 --- a/internal/model/node/model.go +++ b/internal/model/node/model.go @@ -103,7 +103,7 @@ func (m *customServerModel) FilterNodeList(ctx context.Context, params *FilterNo // Multiple group IDs: node must belong to at least one of the groups var conditions []string for _, gid := range params.NodeGroupIds { - conditions = append(conditions, fmt.Sprintf("JSON_CONTAINS(node_group_ids, %d)", gid)) + conditions = append(conditions, fmt.Sprintf("JSON_CONTAINS(node_group_ids, '%d')", gid)) } if len(conditions) > 0 { query = query.Where("(" + strings.Join(conditions, " OR ") + ")")