update
This commit is contained in:
parent
651a59587f
commit
2ae1e48939
@ -161,6 +161,7 @@ async def get_merchant_orders(
|
|||||||
MerchantOrderDB.status == status
|
MerchantOrderDB.status == status
|
||||||
)
|
)
|
||||||
total = query.count()
|
total = query.count()
|
||||||
|
|
||||||
orders = query.offset(skip).limit(limit).all()
|
orders = query.offset(skip).limit(limit).all()
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
@ -319,9 +320,15 @@ async def accept_order(
|
|||||||
merchant_user: UserDB = Depends(get_merchant_user)
|
merchant_user: UserDB = Depends(get_merchant_user)
|
||||||
):
|
):
|
||||||
"""商家接单订单"""
|
"""商家接单订单"""
|
||||||
|
merchant = db.query(MerchantDB).filter(
|
||||||
|
MerchantDB.user_id == merchant_user.userid
|
||||||
|
).first()
|
||||||
|
if not merchant:
|
||||||
|
return error_response(code=404, message="商家不存在")
|
||||||
|
|
||||||
order = db.query(MerchantOrderDB).filter(
|
order = db.query(MerchantOrderDB).filter(
|
||||||
MerchantOrderDB.order_id == order_id,
|
MerchantOrderDB.order_id == order_id,
|
||||||
MerchantOrderDB.merchant_id == merchant_user.userid
|
MerchantOrderDB.merchant_id == merchant.id
|
||||||
).first()
|
).first()
|
||||||
if not order:
|
if not order:
|
||||||
return error_response(code=404, message="订单不存在")
|
return error_response(code=404, message="订单不存在")
|
||||||
|
|||||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user