From 79756800d79d2ba8c2c4a6219ffe9c35f65a0659 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 24 Jun 2026 21:32:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=81=A2=E5=A4=8Dorg=5Fid=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0debug=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/discount_setting/get_products_with_discount.dspy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wwwroot/discount_setting/get_products_with_discount.dspy b/wwwroot/discount_setting/get_products_with_discount.dspy index 1fd4664..1062106 100644 --- a/wwwroot/discount_setting/get_products_with_discount.dspy +++ b/wwwroot/discount_setting/get_products_with_discount.dspy @@ -29,13 +29,16 @@ FROM {product_management}.product p LEFT JOIN {product_management}.product_category pc ON p.category_id = pc.id LEFT JOIN discount_detail dd ON dd.productid = p.id AND dd.discountid = ${discountid}$ -WHERE p.status = '1' +WHERE p.org_id = ${org_id}$ AND p.status = '1' ORDER BY pc.name, p.product_name ''' +ns['org_id'] = user_orgid + db = DBPools() dbname = get_module_dbname('discount') +debug(f'get_products_with_discount: org_id={user_orgid}, discountid={discountid}, dbname={dbname}') async with db.sqlorContext(dbname) as sor: r = await sor.sqlPaging(sql, ns) - debug(f'get_products_with_discount: {len(r.get("rows", []))} products for org {user_orgid}') + debug(f'get_products_with_discount: returned {len(r.get("rows", []))} products') return r