试点修复了 config 模型的拼音字段
This commit is contained in:
@@ -354,18 +354,18 @@ class WechatPayNotifyView(APIView):
|
||||
szjilu, created = Szjilu.objects.select_for_update().get_or_create(
|
||||
id=1,
|
||||
defaults={
|
||||
'zongsy': Decimal('0.00'),
|
||||
'zongls': Decimal('0.00'),
|
||||
'zongzc': Decimal('0.00'),
|
||||
'jrzc': Decimal('0.00'),
|
||||
'jrls': Decimal('0.00')
|
||||
'TotalIncome': Decimal('0.00'),
|
||||
'TotalFlow': Decimal('0.00'),
|
||||
'TotalExpense': Decimal('0.00'),
|
||||
'DailyExpense': Decimal('0.00'),
|
||||
'DailyFlow': Decimal('0.00')
|
||||
}
|
||||
)
|
||||
if created:
|
||||
logger.info("创建ID=1的收支记录")
|
||||
szjilu.zongsy += jine_decimal
|
||||
szjilu.zongls += jine_decimal
|
||||
szjilu.jrls += jine_decimal
|
||||
szjilu.TotalIncome += jine_decimal
|
||||
szjilu.TotalFlow += jine_decimal
|
||||
szjilu.DailyFlow += jine_decimal
|
||||
szjilu.save()
|
||||
logger.info(f"收支记录更新成功,增加金额: {jine}")
|
||||
except Exception as e:
|
||||
@@ -628,18 +628,18 @@ class PaymentVerifyView(APIView):
|
||||
szjilu, created = Szjilu.objects.select_for_update().get_or_create(
|
||||
id=1,
|
||||
defaults={
|
||||
'zongsy': Decimal('0.00'),
|
||||
'zongls': Decimal('0.00'),
|
||||
'zongzc': Decimal('0.00'),
|
||||
'jrzc': Decimal('0.00'),
|
||||
'jrls': Decimal('0.00')
|
||||
'TotalIncome': Decimal('0.00'),
|
||||
'TotalFlow': Decimal('0.00'),
|
||||
'TotalExpense': Decimal('0.00'),
|
||||
'DailyExpense': Decimal('0.00'),
|
||||
'DailyFlow': Decimal('0.00')
|
||||
}
|
||||
)
|
||||
if created:
|
||||
logger.info("创建ID=1的收支记录")
|
||||
szjilu.zongsy += jine_decimal
|
||||
szjilu.zongls += jine_decimal
|
||||
szjilu.jrls += jine_decimal
|
||||
szjilu.TotalIncome += jine_decimal
|
||||
szjilu.TotalFlow += jine_decimal
|
||||
szjilu.DailyFlow += jine_decimal
|
||||
szjilu.save()
|
||||
logger.info(f"收支记录更新成功,增加金额: {jine}")
|
||||
except Exception as e:
|
||||
@@ -3492,7 +3492,7 @@ class ShangjiaLianjieLiuYanZhuanFaView(APIView):
|
||||
return Response({'code': 400, 'msg': '缺少参数'})
|
||||
|
||||
try:
|
||||
lianjie = ShangjiaLianjie.query.get(lianjie_token=token)
|
||||
lianjie = ShangjiaLianjie.query.get(LinkToken=token)
|
||||
except ShangjiaLianjie.DoesNotExist:
|
||||
return Response({'code': 404, 'msg': '链接不存在或已失效'})
|
||||
|
||||
@@ -3504,7 +3504,7 @@ class ShangjiaLianjieLiuYanZhuanFaView(APIView):
|
||||
except Order.DoesNotExist:
|
||||
return Response({'code': 500, 'msg': '订单数据异常'})
|
||||
|
||||
shangjia_uid = lianjie.yonghu_id
|
||||
shangjia_uid = lianjie.UserID
|
||||
sender_id = f"B{shangjia_uid}"
|
||||
sender_name = "老板"
|
||||
sender_avatar = ''
|
||||
@@ -5557,9 +5557,9 @@ class AdTongYiTuiKuanPingTai(APIView):
|
||||
|
||||
|
||||
szjilu_obj = Szjilu.query.get(id=1)
|
||||
szjilu_obj.zongsy -= jine
|
||||
szjilu_obj.zongzc += jine
|
||||
szjilu_obj.jrzc += jine
|
||||
szjilu_obj.TotalIncome -= jine
|
||||
szjilu_obj.TotalExpense += jine
|
||||
szjilu_obj.DailyExpense += jine
|
||||
szjilu_obj.save()
|
||||
except Szjilu.DoesNotExist:
|
||||
logger.error(f"平台退款:收支记录表(id=1)不存在,跳过")
|
||||
|
||||
Reference in New Issue
Block a user