diff --git a/backend/app/services/task_service.py b/backend/app/services/task_service.py index 5a23a1d..3224e14 100644 --- a/backend/app/services/task_service.py +++ b/backend/app/services/task_service.py @@ -46,7 +46,7 @@ async def _recalc_product_location( 优先级: WIP > PENDING > COMPLETED/ARCHIVED > None """ - from sqlalchemy import select as sa_select, case as sa_case, func as sa_func + from sqlalchemy import select as sa_select, case as sa_case, or_ as sa_or_ product_result = await db.execute( sa_select(Product).where(Product.id == product_id) @@ -60,7 +60,7 @@ async def _recalc_product_location( sa_select(Task) .where( Task.product_id == product_id, - sa_func.or_( + sa_or_( Task.parent_task_id.is_(None), Task.task_type.in_(["TRANSFER", "RECOVERY"]), ),