fix: task查询按project_id过滤

This commit is contained in:
yumoqing 2026-08-07 17:43:43 +08:00
parent 64ba5daf92
commit fe5b7a98ec

View File

@ -26,11 +26,11 @@ async with DBPools().sqlorContext(dbname) as sor:
if precs and len(precs) > 0:
pname = getattr(precs[0], 'name', '') or ''
# Get tasks
# Get tasks for this project (tenant_id = project_id for SDLC tasks)
tasks = await sor.sqlExe(
"SELECT id, title, state, current_version, created_at, params, role "
"FROM pipeline_tasks WHERE tenant_id='0' ORDER BY created_at DESC LIMIT 50",
{})
"FROM pipeline_tasks WHERE tenant_id=${pid}$ ORDER BY created_at DESC LIMIT 50",
{"pid": pid})
task_list = []
for t in tasks: