This commit is contained in:
aaron 2025-02-28 14:35:36 +08:00
parent 206754a13d
commit db01d32dda

View File

@ -1373,7 +1373,13 @@ async def check_new_orders(
# 从Redis获取新订单ID列表
order_ids = redis_client.pop_orders_from_queue(deliveryman.community_id, 10)
return success_response(data={
"has_new_order": len(order_ids) > 0,
"order_ids": order_ids
})
if not order_ids:
return success_response(data={
"has_new_order": False,
"order_ids": []
})
else:
return success_response(data={
"has_new_order": len(order_ids) > 0,
"order_ids": order_ids
})