From ab64d2aa0a63777d65eb3e724fb1728809488f1d Mon Sep 17 00:00:00 2001 From: "34047007@qq.com" <34047007@qq.com> Date: Mon, 10 Aug 2026 18:06:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=90=9C=E7=B4=A2=E9=A1=B5=20filter-opt?= =?UTF-8?q?ions=20500=20=E2=80=94=20nlm=5Fsubsets=20@>=20ARRAY[...]=20?= =?UTF-8?q?=E8=A1=A5=20::varchar[]=20cast=EF=BC=88varchar[]=20vs=20text[]?= =?UTF-8?q?=20=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=8C=B9=E9=85=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/features.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/api/v1/features.py b/backend/app/api/v1/features.py index 6fd294e..cab639d 100644 --- a/backend/app/api/v1/features.py +++ b/backend/app/api/v1/features.py @@ -206,7 +206,7 @@ async def _load_filter_options(db: AsyncSession) -> dict: # 3. nlm_subsets(单次 JOIN + COUNT FILTER,代替 8 次独立查询) # 注:code 来自上方 NLM_SUBSET_LABELS 硬编码常量,无注入风险 subset_filter_cols = ", ".join( - f'COUNT(*) FILTER (WHERE j.nlm_subsets @> ARRAY[\'{code}\']) AS "{code}"' + f'COUNT(*) FILTER (WHERE j.nlm_subsets @> ARRAY[\'{code}\']::varchar[]) AS "{code}"' for code in NLM_SUBSET_LABELS ) subset_row = (await db.execute(text(f"""