试点修复了 config 模型的拼音字段
This commit is contained in:
@@ -689,18 +689,18 @@ class YajinHuitiao(View):
|
||||
szjilu, created = Szjilu.query.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')
|
||||
}
|
||||
)
|
||||
|
||||
# 更新三个字段
|
||||
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()
|
||||
|
||||
@@ -1204,18 +1204,18 @@ class JifenHuitiao(View):
|
||||
szjilu, created = Szjilu.query.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')
|
||||
}
|
||||
)
|
||||
|
||||
# 更新三个字段
|
||||
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()
|
||||
|
||||
@@ -1778,12 +1778,12 @@ class HuiyuanHuitiao(View):
|
||||
|
||||
szjilu, _ = Szjilu.query.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')}
|
||||
defaults={'TotalIncome': Decimal('0.00'), 'TotalFlow': Decimal('0.00'), 'TotalExpense': Decimal('0.00'),
|
||||
'DailyExpense': Decimal('0.00'), 'DailyFlow': Decimal('0.00')}
|
||||
)
|
||||
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"收支记录更新成功: 订单{order.dingdan_id}, 金额{jine_decimal}元")
|
||||
except Exception as e:
|
||||
@@ -2612,18 +2612,18 @@ class ShangjiaHuitiao(View):
|
||||
szjilu, created = Szjilu.query.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')
|
||||
}
|
||||
)
|
||||
|
||||
# 更新三个字段
|
||||
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()
|
||||
|
||||
@@ -4362,12 +4362,12 @@ class AdShangpinHuQu(APIView):
|
||||
)
|
||||
|
||||
# 6. 查询公告数据(类型=1的公告)
|
||||
gonggao_obj = Gonggao.query.filter(leixing=1).first()
|
||||
shangpingonggao = gonggao_obj.jieshao if gonggao_obj else ''
|
||||
gonggao_obj = Gonggao.query.filter(NoticeType=1).first()
|
||||
shangpingonggao = gonggao_obj.Content if gonggao_obj else ''
|
||||
|
||||
# 7. 查询轮播图数据(类型=1的轮播图)
|
||||
lunbo_objs = Lunbo.query.filter(leixing=1).values('tupian_url')
|
||||
shangpinlunbo = [item['tupian_url'] for item in lunbo_objs]
|
||||
lunbo_objs = Lunbo.query.filter(ImageType=1).values('ImageURL')
|
||||
shangpinlunbo = [item['ImageURL'] for item in lunbo_objs]
|
||||
|
||||
# 8. 查询商品类型数据
|
||||
shangpinleixing_data = ShangpinLeixing.query.all().values(
|
||||
@@ -4495,14 +4495,14 @@ class AdGonggaoXiuGai(APIView):
|
||||
)
|
||||
|
||||
# 8. 查询公告表,类型为1的公告
|
||||
gonggao_obj = Gonggao.query.filter(leixing=1).first()
|
||||
gonggao_obj = Gonggao.query.filter(NoticeType=1).first()
|
||||
|
||||
# 如果不存在,则创建
|
||||
if not gonggao_obj:
|
||||
gonggao_obj = Gonggao(leixing=1)
|
||||
gonggao_obj = Gonggao(NoticeType=1)
|
||||
|
||||
# 9. 更新公告内容
|
||||
gonggao_obj.jieshao = gonggao_neirong
|
||||
gonggao_obj.Content = gonggao_neirong
|
||||
gonggao_obj.save()
|
||||
|
||||
# 10. 返回成功响应
|
||||
@@ -4685,7 +4685,7 @@ class AdLunboXiuGai(APIView):
|
||||
)
|
||||
|
||||
# 查询轮播图记录
|
||||
lunbo_obj = Lunbo.query.filter(tupian_url=tupian_url, leixing=1).first()
|
||||
lunbo_obj = Lunbo.query.filter(ImageURL=tupian_url, ImageType=1).first()
|
||||
|
||||
if not lunbo_obj:
|
||||
return Response(
|
||||
@@ -4761,15 +4761,15 @@ class AdLunboXiuGai(APIView):
|
||||
|
||||
# 创建轮播图记录
|
||||
lunbo_obj = Lunbo.query.create(
|
||||
tupian_url=oss_file_path, # 存相对路径
|
||||
leixing=1
|
||||
ImageURL=oss_file_path, # 存相对路径
|
||||
ImageType=1
|
||||
)
|
||||
|
||||
return Response({
|
||||
'code': 0,
|
||||
'message': '添加成功',
|
||||
'data': {
|
||||
'tupian_url': lunbo_obj.tupian_url
|
||||
'tupian_url': lunbo_obj.ImageURL
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user