update
This commit is contained in:
parent
15f63a12a2
commit
9346497f38
@ -249,7 +249,9 @@ async def get_group_by_community(
|
|||||||
):
|
):
|
||||||
"""根据社区进行 group 的配送时段列表"""
|
"""根据社区进行 group 的配送时段列表"""
|
||||||
try:
|
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 的配送时段列表
|
#3. 根据社区进行 group 的配送时段列表
|
||||||
communities_with_time_periods = []
|
communities_with_time_periods = []
|
||||||
@ -269,8 +271,7 @@ async def get_group_by_community(
|
|||||||
"capacity": ctp.CommunityTimePeriodDB.capacity
|
"capacity": ctp.CommunityTimePeriodDB.capacity
|
||||||
} for ctp in community_time_periods]
|
} for ctp in community_time_periods]
|
||||||
})
|
})
|
||||||
|
return success_response(data={"total": total, "items": communities_with_time_periods})
|
||||||
return success_response(data=communities_with_time_periods)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception(f"获取社区配送时段列表失败: {str(e)}")
|
logging.exception(f"获取社区配送时段列表失败: {str(e)}")
|
||||||
|
|||||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user