fix: 手动提现取消积分限制,驳回按申请扣款额全额退回各身份余额
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2021,9 +2021,12 @@ class TixianShenqingView(APIView):
|
||||
leixing=leixing,
|
||||
zhifu=zhifu,
|
||||
skzhanghao=skzhanghao,
|
||||
jine=shijidaozhang, # 记录实际到账金额
|
||||
zhuangtai=1, # 审核中
|
||||
jine=shijidaozhang,
|
||||
shenqing_jine=jine,
|
||||
shouxufei=shouxufei,
|
||||
zhuangtai=1,
|
||||
fangshi=fangshi,
|
||||
dakuan_mode=1,
|
||||
shenheid=None,
|
||||
bhliyou='',
|
||||
)
|
||||
@@ -2067,8 +2070,6 @@ class TixianShenqingView(APIView):
|
||||
return {'code': 11, 'msg': '打手账号已被封禁,无法提现'}
|
||||
if dashou.zhuangtai != 1:
|
||||
return {'code': 12, 'msg': '您有订单进行中,请完成后提现'}
|
||||
if dashou.jifen != 10:
|
||||
return {'code': 15, 'msg': '积分不足10分,请补充积分后提现'}
|
||||
if dashou.yue < jine:
|
||||
return {'code': 13, 'msg': f'余额不足,当前余额: {dashou.yue}'}
|
||||
|
||||
@@ -5749,25 +5750,9 @@ class AdtixianqkView(APIView):
|
||||
withdrawal.shenheid = request.user.yonghuid
|
||||
|
||||
if result == 3: # 拒绝
|
||||
|
||||
# 获取用户主表
|
||||
user_main = UserMain.objects.get(yonghuid=withdrawal.yonghuid)
|
||||
# 根据提现类型返还余额
|
||||
if withdrawal.leixing == 1:
|
||||
dashou = UserDashou.objects.select_for_update().get(user=user_main)
|
||||
dashou.yue += withdrawal.jine
|
||||
dashou.save()
|
||||
elif withdrawal.leixing == 2:
|
||||
guanshi = UserGuanshi.objects.select_for_update().get(user=user_main)
|
||||
guanshi.yue += withdrawal.jine
|
||||
guanshi.save()
|
||||
else:
|
||||
# 记录日志,不应发生
|
||||
logger.error(f"未知提现类型 {withdrawal.leixing},无法返还余额")
|
||||
|
||||
|
||||
|
||||
|
||||
from yonghu.tixian_shenhe_services import refund_manual_tixianjilu
|
||||
refund_manual_tixianjilu(user_main, withdrawal)
|
||||
withdrawal.bhliyou = reason
|
||||
|
||||
withdrawal.update_time = timezone.now()
|
||||
@@ -12161,22 +12146,8 @@ class KefuWithdrawActionView(APIView):
|
||||
except Exception as e:
|
||||
logger.error(f'更新收支记录失败: {e}')
|
||||
else:
|
||||
if tixian.leixing == 1:
|
||||
try:
|
||||
dashou = user.dashou_profile
|
||||
dashou.yue += tixian.jine
|
||||
dashou.save()
|
||||
except ObjectDoesNotExist:
|
||||
raise ValueError(f'打手信息不存在: {tixian.yonghuid}')
|
||||
elif tixian.leixing == 2:
|
||||
try:
|
||||
guanshi = user.guanshi_profile
|
||||
guanshi.yue += tixian.jine
|
||||
guanshi.save()
|
||||
except ObjectDoesNotExist:
|
||||
raise ValueError(f'管事信息不存在: {tixian.yonghuid}')
|
||||
else:
|
||||
logger.error(f'未知提现类型 {tixian.leixing},无法返还余额')
|
||||
from .tixian_shenhe_services import refund_manual_tixianjilu
|
||||
refund_manual_tixianjilu(user, tixian)
|
||||
tixian.zhuangtai = 3
|
||||
tixian.bhliyou = reason
|
||||
|
||||
|
||||
Reference in New Issue
Block a user