fix: 仅体验会员禁止余额抵扣,正式会员恢复抵扣
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user