From 51a1616b9fbd93cdc4d4834503c92e47b56d0295 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 3 Jul 2026 18:06:56 +0800 Subject: [PATCH] fix: restore IS NULL OR * to cover both conventions; keep direct dd.discount without GROUP BY --- discount/init.py | 2 +- wwwroot/marketing_discount_setting/get_products.dspy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discount/init.py b/discount/init.py index 696da01..1ad3139 100644 --- a/discount/init.py +++ b/discount/init.py @@ -830,7 +830,7 @@ async def get_marketing_discount_products(request): SELECT dd.productid, dd.discount FROM discount_detail dd JOIN discount d ON dd.discountid = d.id - WHERE d.resellerid = ${org_id}$ AND d.customerid = '*' + WHERE d.resellerid = ${org_id}$ AND (d.customerid IS NULL OR d.customerid = '*') ) base ON base.productid = p.id LEFT JOIN discount_detail mkt ON mkt.productid = p.id AND mkt.discountid = ${discountid}$ WHERE p.org_id = ${org_id}$ AND p.status = '1' diff --git a/wwwroot/marketing_discount_setting/get_products.dspy b/wwwroot/marketing_discount_setting/get_products.dspy index ca5c59b..771709f 100644 --- a/wwwroot/marketing_discount_setting/get_products.dspy +++ b/wwwroot/marketing_discount_setting/get_products.dspy @@ -32,7 +32,7 @@ LEFT JOIN ( SELECT dd.productid, dd.discount FROM discount_detail dd JOIN discount d ON dd.discountid = d.id - WHERE d.resellerid = ${org_id}$ AND d.customerid = '*' + WHERE d.resellerid = ${org_id}$ AND (d.customerid IS NULL OR d.customerid = '*') ) base ON base.productid = p.id LEFT JOIN discount_detail mkt ON mkt.productid = p.id AND mkt.discountid = ${discountid}$ WHERE p.org_id = ${org_id}$ AND p.status = '1'