From 3ad1286379eb3d25c3ced9b7f25018dc75df308f Mon Sep 17 00:00:00 2001 From: aaron <> Date: Mon, 24 Mar 2025 14:21:57 +0800 Subject: [PATCH] update --- app/api/endpoints/merchant_product.py | 4 ++++ jobs.sqlite | Bin 24576 -> 24576 bytes 2 files changed, 4 insertions(+) diff --git a/app/api/endpoints/merchant_product.py b/app/api/endpoints/merchant_product.py index 0bea133..76ee101 100644 --- a/app/api/endpoints/merchant_product.py +++ b/app/api/endpoints/merchant_product.py @@ -76,6 +76,7 @@ async def update_product( @router.get("/list", response_model=ResponseModel) async def list_merchant_products( merchant_id: Optional[int] = None, + community_id: Optional[int] = None, skip: int = 0, limit: int = 20, db: Session = Depends(get_db) @@ -89,6 +90,9 @@ async def list_merchant_products( # 如果指定了商家ID,添加筛选条件 if 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() results = query.order_by( diff --git a/jobs.sqlite b/jobs.sqlite index 557e0981e79ac3a4ebb288aab32f535477db01f7..ea46daf417bfe7420042bb741c11f09b0093c38f 100644 GIT binary patch delta 82 zcmZoTz}Rqrae_3X=tLQ3M$wH4`9jPOn{RBkb(dw{{9e?Ukx_E9vUo2G`@@co2G*%g jlO5e