未知(继上次中断)

This commit is contained in:
Cheng Zhou
2026-02-04 10:52:34 +08:00
parent 8e258d21a7
commit 737f84bf54
99 changed files with 5497 additions and 2143 deletions
+5
View File
@@ -39,6 +39,7 @@ async def list_contracts(
db: AsyncSession,
study_id: uuid.UUID,
site_name: str | None = None,
site_names: set[str] | None = None,
contract_no: str | None = None,
skip: int = 0,
limit: int = 100,
@@ -47,6 +48,10 @@ async def list_contracts(
select(FinanceContract)
.where(FinanceContract.study_id == study_id)
)
if site_names is not None:
if not site_names:
return []
stmt = stmt.where(FinanceContract.site_name.in_(site_names))
if site_name:
stmt = stmt.where(FinanceContract.site_name.ilike(f"%{site_name}%"))
if contract_no: