From 52d48c964aa00aa0b37c6572af4f7e8d692f949c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 29 Jun 2026 15:56:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ORDER=20BY=E6=94=B9=E7=94=A8$=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discount/init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discount/init.py b/discount/init.py index 4eb29ff..8026138 100644 --- a/discount/init.py +++ b/discount/init.py @@ -765,9 +765,10 @@ async def get_discount_setting_products(request): LEFT JOIN discount_detail dd ON dd.productid = p.id AND dd.discountid = ${discountid}$ WHERE p.org_id = ${org_id}$ AND p.status = '1' - ORDER BY pc.name, p.product_name + ORDER BY ${sort}$ """ + ns = {'discountid': discountid, 'org_id': user_orgid, 'sort': 'pc.name, p.product_name'} async with db.sqlorContext(dbname) as sor: - recs = await sor.sqlExe(sql, {'discountid': discountid, 'org_id': user_orgid}) + recs = await sor.sqlExe(sql, ns) return recs if recs else []