增加时段的筛选
This commit is contained in:
parent
ba64875b5c
commit
232a49ba32
@ -805,6 +805,7 @@ async def deliveryman_orders(
|
||||
status: Optional[str] = None,
|
||||
building_id: Optional[int] = None,
|
||||
community_id: Optional[int] = None,
|
||||
time_period_id: Optional[int] = None,
|
||||
skip: int = 0,
|
||||
limit: int = 20,
|
||||
db: Session = Depends(get_db),
|
||||
@ -832,6 +833,10 @@ async def deliveryman_orders(
|
||||
# 小区筛选
|
||||
if community_id:
|
||||
query = query.filter(ShippingOrderDB.address_community_id == community_id)
|
||||
|
||||
# 配送时段筛选
|
||||
if time_period_id:
|
||||
query = query.filter(ShippingOrderDB.time_period_id == time_period_id)
|
||||
|
||||
# 获取总数
|
||||
total = query.count()
|
||||
@ -898,7 +903,11 @@ async def deliveryman_orders(
|
||||
"complete_images": order.optimized_complete_images,
|
||||
"received_time": order.received_time,
|
||||
"pickup_time": order.pickup_time,
|
||||
"completed_time": order.completed_time
|
||||
"completed_time": order.completed_time,
|
||||
"time_period_id": order.time_period_id,
|
||||
"time_period_name": order.time_period_name,
|
||||
"time_period_from_time": order.time_period_from_time,
|
||||
"time_period_to_time": order.time_period_to_time
|
||||
})
|
||||
|
||||
return success_response(data={
|
||||
|
||||
Loading…
Reference in New Issue
Block a user