修复前后端显示异常问题(受试者、中心、负责人、日期等)

This commit is contained in:
Cheng Zhou
2025-12-18 22:09:28 +08:00
parent fb4950f8f7
commit 7137665410
48 changed files with 764 additions and 156 deletions
+8
View File
@@ -46,3 +46,11 @@ async def list_by_study(db: AsyncSession, study_id: uuid.UUID, skip: int = 0, li
select(Site).where(Site.study_id == study_id).offset(skip).limit(limit)
)
return result.scalars().all()
async def get_sites_by_ids(db: AsyncSession, ids: set[uuid.UUID]) -> dict[uuid.UUID, Site]:
if not ids:
return {}
result = await db.execute(select(Site).where(Site.id.in_(ids)))
sites = result.scalars().all()
return {s.id: s for s in sites}