增加 community id 参数

This commit is contained in:
aaron 2025-02-23 01:34:05 +08:00
parent bd8a3d90d1
commit 647bf6722a

View File

@ -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()