From dc22552640ed789c31e448df293eb65b3f690ac7 Mon Sep 17 00:00:00 2001 From: XingQue Date: Tue, 21 Jul 2026 22:38:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=8D=95=E6=9C=89=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E4=BA=BA=E7=9A=84=E6=89=93=E6=89=8B=E5=BC=BA=E5=88=B6=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E5=BC=8F=E5=95=86=E5=93=81=EF=BC=8C=E5=B9=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=A1=A5=E5=86=99=E6=89=AB=E7=A0=81=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=EF=BC=9B=E6=9C=AA=E7=99=BB=E5=BD=95=E6=89=93=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BE=BF=E4=BA=8E=E6=8E=92=E6=9F=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- shangpin/views.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/shangpin/views.py b/shangpin/views.py index 8767879..ef13e40 100644 --- a/shangpin/views.py +++ b/shangpin/views.py @@ -45,13 +45,14 @@ class ShangpinHuoquView(APIView): yonghuid, ) return 4 - # 打手且有邀请人:与扫码同等效果 - has_inviter = UserDashou.objects.filter(user_id=user.pk).exclude( - yaoqingren__isnull=True, - ).exclude(yaoqingren='').exists() - if has_inviter: + # 打手且有邀请人:与扫码同等效果;顺带补写扫码标记,避免下次再漏 + dashou = UserDashou.objects.filter(user_id=user.pk).only('yaoqingren').first() + inviter = (dashou.yaoqingren or '').strip() if dashou else '' + if inviter: + UserMain.objects.filter(pk=user.pk).exclude(guanshi_saoma=1).update(guanshi_saoma=1) logger.info( - '点单商品:打手有邀请人,强制隐藏式4 yonghuid=%s', + '点单商品:打手有邀请人(%s),强制隐藏式4 yonghuid=%s', + inviter, yonghuid, ) return 4 @@ -60,6 +61,8 @@ class ShangpinHuoquView(APIView): saoma, yonghuid, ) + else: + logger.info('点单商品:未登录/无token,按体验开关筛选') shenhe = get_shangpin_shenhe_zhuangtai() logger.info('点单商品:按体验开关 shenhezhuangtai=%s', shenhe) return shenhe