update
This commit is contained in:
parent
6d16699c02
commit
3ad1286379
@ -76,6 +76,7 @@ async def update_product(
|
|||||||
@router.get("/list", response_model=ResponseModel)
|
@router.get("/list", response_model=ResponseModel)
|
||||||
async def list_merchant_products(
|
async def list_merchant_products(
|
||||||
merchant_id: Optional[int] = None,
|
merchant_id: Optional[int] = None,
|
||||||
|
community_id: Optional[int] = None,
|
||||||
skip: int = 0,
|
skip: int = 0,
|
||||||
limit: int = 20,
|
limit: int = 20,
|
||||||
db: Session = Depends(get_db)
|
db: Session = Depends(get_db)
|
||||||
@ -89,6 +90,9 @@ async def list_merchant_products(
|
|||||||
# 如果指定了商家ID,添加筛选条件
|
# 如果指定了商家ID,添加筛选条件
|
||||||
if merchant_id:
|
if merchant_id:
|
||||||
query = query.filter(MerchantProductDB.merchant_id == merchant_id)
|
query = query.filter(MerchantProductDB.merchant_id == merchant_id)
|
||||||
|
|
||||||
|
if community_id:
|
||||||
|
query = query.filter(MerchantProductDB.merchant.has(community_id=community_id))
|
||||||
|
|
||||||
total = query.count()
|
total = query.count()
|
||||||
results = query.order_by(
|
results = query.order_by(
|
||||||
|
|||||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user