From c39e54f379efcf734d1638df5266bdc8256faf33 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 3 Jul 2026 18:05:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20dspy=20same=20fix=20=E2=80=94=20remove?= =?UTF-8?q?=20IS=20NULL,=20remove=20GROUP=20BY,=20use=20dd.discount=20dire?= =?UTF-8?q?ctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/marketing_discount_setting/get_products.dspy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wwwroot/marketing_discount_setting/get_products.dspy b/wwwroot/marketing_discount_setting/get_products.dspy index 5cd2d8a..ca5c59b 100644 --- a/wwwroot/marketing_discount_setting/get_products.dspy +++ b/wwwroot/marketing_discount_setting/get_products.dspy @@ -29,11 +29,10 @@ SELECT FROM product p LEFT JOIN product_category pc ON p.category_id = pc.id LEFT JOIN ( - SELECT dd.productid, MAX(dd.discount) as discount + 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 IS NULL OR d.customerid = '*') - GROUP BY dd.productid + WHERE d.resellerid = ${org_id}$ AND 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'