From 647bf6722a4ccffda455dc5e9ef0c1353bc42207 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Sun, 23 Feb 2025 01:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20community=20id=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/endpoints/order.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/api/endpoints/order.py b/app/api/endpoints/order.py index 575de47..8f8cb51 100644 --- a/app/api/endpoints/order.py +++ b/app/api/endpoints/order.py @@ -681,6 +681,7 @@ async def cancel_order( async def get_deliveryman_orders( status: Optional[str] = None, building_id: Optional[int] = None, + community_id: Optional[int] = None, skip: int = 0, limit: int = 20, db: Session = Depends(get_db), @@ -704,6 +705,10 @@ async def get_deliveryman_orders( # 楼栋筛选 if building_id: query = query.filter(ShippingOrderDB.address_community_building_id == building_id) + + # 小区筛选 + if community_id: + query = query.filter(ShippingOrderDB.address_community_id == community_id) # 获取总数 total = query.count()