From b3c61a675870012816c854f3281e44ffe25622b4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 14 Jul 2026 16:07:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20p.name=E2=86=92p.product=5Fname;=20remov?= =?UTF-8?q?e=20spurious=20COLLATE=20in=20JOIN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/get_reseller_reconcile.dspy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wwwroot/get_reseller_reconcile.dspy b/wwwroot/get_reseller_reconcile.dspy index ecc73da..13761ec 100644 --- a/wwwroot/get_reseller_reconcile.dspy +++ b/wwwroot/get_reseller_reconcile.dspy @@ -27,17 +27,17 @@ if sub_reseller_id: sc_sql = f""" SELECT sa.productid, - p.name as productid_text, + p.product_name as productid_text, COUNT(*) as tx_count, SUM(sa.quantity) as total_qty, SUM(sa.dist_amount) as our_total_amount, SUM(sa.supply_amount) as supply_total_amount, SUM(sa.profit_amount) as profit_total_amount FROM supplychain_accounting sa -LEFT JOIN product p ON sa.productid = p.id COLLATE utf8mb4_unicode_ci +LEFT JOIN product p ON sa.productid = p.id {sc_where} -GROUP BY sa.productid, p.name -ORDER BY p.name +GROUP BY sa.productid, p.product_name +ORDER BY p.product_name """ # 我方账务: accounting_log 中与该分销商相关的记账汇总 @@ -49,7 +49,7 @@ SELECT SUM(CASE WHEN bd.accounting_dir = 'D' THEN bd.amount ELSE 0 END) as acc_debit, SUM(CASE WHEN bd.accounting_dir = 'C' THEN bd.amount ELSE 0 END) as acc_credit FROM bill_detail bd -INNER JOIN bill b ON bd.billid = b.id COLLATE utf8mb4_unicode_ci +INNER JOIN bill b ON bd.billid = b.id WHERE b.resellerid = ${userorgid}$ """ acc_params = {'userorgid': userorgid}