From b20c580193ba8cb1263c19de2779bbcbcf214de4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 29 Jun 2026 13:18:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20discountid=E4=BC=98=E5=85=88=E4=BB=8Ereq?= =?UTF-8?q?uest.=5Frun=5Fenv.param=5Fkw=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discount/init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discount/init.py b/discount/init.py index 7b819e6..49001e5 100644 --- a/discount/init.py +++ b/discount/init.py @@ -741,12 +741,12 @@ async def get_discount_setting_products(request): env = request._run_ns # Try multiple ways to get discountid from URL query params discountid = '' - if hasattr(request, 'rel_url') and request.rel_url: + if hasattr(request, '_run_env') and hasattr(request._run_env, 'param_kw'): + discountid = (request._run_env.param_kw or {}).get('discountid', '') + if not discountid and hasattr(request, 'rel_url') and request.rel_url: discountid = request.rel_url.query.get('discountid', '') if not discountid and hasattr(request, 'query'): discountid = request.query.get('discountid', '') - if not discountid: - discountid = (getattr(request, '_params_kw', {}) or {}).get('discountid', '') user_orgid = await env.get_userorgid() if not discountid or not user_orgid: