From de0b070e2404a2bfab5ce4b8724d07da2e779618 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 2 Sep 2026 18:14:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=5Fopen=5Fqc=5Ftype=5Ftasks=E7=9A=84LIKE?= =?UTF-8?q?=E9=80=9A=E9=85=8D=E7=AC=A6=E7=94=A8=E6=8B=BC=E6=8E=A5=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E2=80=94=E2=80=94%=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=B8=8ESQL=E9=80=9A=E9=85=8D=E7=AC=A6=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E8=87=B4=E5=AF=B9=E8=B4=A6=E5=99=A8=E6=AF=8F=E8=BD=AE=E5=B4=A9?= =?UTF-8?q?=E6=BA=83(=E5=AE=9E=E6=B5=8B15=E7=A7=92=E4=B8=80=E6=8A=A5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_bidding/bid_flow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipeline_bidding/bid_flow.py b/pipeline_bidding/bid_flow.py index b3e395a..705bb04 100644 --- a/pipeline_bidding/bid_flow.py +++ b/pipeline_bidding/bid_flow.py @@ -159,11 +159,12 @@ async def _dim_qc_improvements(sor, project_id, dim): async def _open_qc_type_tasks(sor, project_id, qc_type): """某类型在办 QC 审核任务数(params.qc_types 含该类型)。""" + kw = '%"qc_types": ["' + qc_type + '"]%' # 拼接构造:SQL 里 % 是 LIKE 通配符,不能用 % 格式化 recs = await sor.sqlExe( "SELECT COUNT(*) AS c FROM pipeline_tasks WHERE tenant_id=${p}$ " "AND pipeline_id='role_task' AND role=${r}$ AND state IN " "('submitted','running','review','qc_review') AND params LIKE ${kw}$", - {"p": project_id, "r": R_QC, "kw": '%"qc_types": ["%s"]%' % qc_type}) + {"p": project_id, "r": R_QC, "kw": kw}) await sor.sqlExe("COMMIT", {}) return to_int(getattr(recs[0], "c", 0) if recs else 0)