From eb1fc6d2ae21b673cd44b15211e1e2d31dce226d Mon Sep 17 00:00:00 2001 From: XingQue Date: Fri, 26 Jun 2026 01:47:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=85=E4=BD=93=E9=AA=8C=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E7=A6=81=E6=AD=A2=E4=BD=99=E9=A2=9D=E6=8A=B5=E6=89=A3?= =?UTF-8?q?=EF=BC=8C=E6=AD=A3=E5=BC=8F=E4=BC=9A=E5=91=98=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E6=8A=B5=E6=89=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- products/views.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/products/views.py b/products/views.py index 1d504a7..9dd33f0 100644 --- a/products/views.py +++ b/products/views.py @@ -5733,6 +5733,7 @@ class CzhqdyView(APIView): huiyuan_id = request.data.get('huiyuan_id') yajin_jine = request.data.get('yajin_jine') fadan_id = request.data.get('fadan_id') + is_trial = bool(request.data.get('is_trial') or request.data.get('isTrial')) # 参数校验 if leixing not in [1, 2, 3, 4]: @@ -5741,6 +5742,12 @@ class CzhqdyView(APIView): if leixing == 1 and not huiyuan_id: return Response({'code': 400, 'msg': '购买会员时必须提供 huiyuan_id'}, status=status.HTTP_400_BAD_REQUEST) + if leixing == 1 and is_trial: + return Response({ + 'code': 400, + 'msg': '体验会员仅支持微信支付,不可用佣金、分红或押金抵扣', + }, status=status.HTTP_400_BAD_REQUEST) + if leixing == 2: if not yajin_jine: return Response({'code': 400, 'msg': '购买押金时必须提供 yajin_jine'}, status=status.HTTP_400_BAD_REQUEST) @@ -5876,17 +5883,19 @@ class DsqrgmdhView(APIView): yajin_jine = request.data.get('yajin_jine') fadan_id = request.data.get('fadan_id') - logger.info(f"抵扣支付请求: leixing={leixing}, shenfen_id={shenfen_id}, huiyuan_id={huiyuan_id}, yajin_jine={yajin_jine}, fadan_id={fadan_id}") + is_trial = bool(request.data.get('is_trial') or request.data.get('isTrial')) + + logger.info(f"抵扣支付请求: leixing={leixing}, shenfen_id={shenfen_id}, huiyuan_id={huiyuan_id}, yajin_jine={yajin_jine}, fadan_id={fadan_id}, is_trial={is_trial}") if leixing not in [1, 2, 3, 4]: return Response({'code': 400, 'msg': 'leixing 必须为 1/2/3/4'}, status=status.HTTP_400_BAD_REQUEST) if shenfen_id not in [1, 2, 3, 4]: return Response({'code': 400, 'msg': 'shenfen_id 必须为 1/2/3/4'}, status=status.HTTP_400_BAD_REQUEST) - if leixing == 1: + if leixing == 1 and is_trial: return Response({ 'code': 400, - 'msg': '会员购买仅支持微信支付,请使用会员充值页面', + 'msg': '体验会员仅支持微信支付,不可用佣金、分红或押金抵扣', }, status=status.HTTP_400_BAD_REQUEST) if leixing == 2: if not yajin_jine: