This commit is contained in:
aaron 2025-03-18 22:53:36 +08:00
parent 15f63a12a2
commit 9346497f38
2 changed files with 4 additions and 3 deletions

View File

@ -249,7 +249,9 @@ async def get_group_by_community(
):
"""根据社区进行 group 的配送时段列表"""
try:
communities = db.query(CommunityDB).offset(skip).limit(limit).all()
communities = db.query(CommunityDB).order_by(CommunityDB.id.desc()).offset(skip).limit(limit).all()
total = db.query(CommunityDB).count()
#3. 根据社区进行 group 的配送时段列表
communities_with_time_periods = []
@ -269,8 +271,7 @@ async def get_group_by_community(
"capacity": ctp.CommunityTimePeriodDB.capacity
} for ctp in community_time_periods]
})
return success_response(data=communities_with_time_periods)
return success_response(data={"total": total, "items": communities_with_time_periods})
except Exception as e:
logging.exception(f"获取社区配送时段列表失败: {str(e)}")

Binary file not shown.