补充修改
This commit is contained in:
@@ -775,19 +775,19 @@ class CreateOrderView(APIView):
|
||||
order_data = {
|
||||
'OrderID': dingdanid,
|
||||
'Status': 9, # 未付款状态
|
||||
'jine': shangpin_jiage,
|
||||
'Amount': shangpin_jiage,
|
||||
'Platform':1,
|
||||
'PlayerCommission': dashou_fencheng,
|
||||
'AssignedID': zhiding_id_value,
|
||||
'shangpin_id': shangpin_id,
|
||||
'ProductID': shangpin_id,
|
||||
'GrabRequirement': getattr(shangpin, 'GrabRequirement', None),
|
||||
'MembershipID': getattr(shangpin, 'MembershipID', ''),
|
||||
'CommissionReq': getattr(shangpin, 'CommissionReq', 0),
|
||||
'Description': getattr(shangpin, 'Description', ''),
|
||||
'Remark': beizhu,
|
||||
'nicheng': nicheng,
|
||||
'Nickname': nicheng,
|
||||
'ImageURL':shangpin_tupian,
|
||||
'user1_id':f"Boss{request.user.yonghuid}",
|
||||
'User1ID':f"Boss{request.user.yonghuid}",
|
||||
'ProductTypeID':shangpin.ProductTypeID
|
||||
}
|
||||
|
||||
@@ -1076,7 +1076,7 @@ class DingdanHuoquView(APIView):
|
||||
status_query = Q(Status__in=zhuangtai_list)
|
||||
|
||||
query = Q(OrderID__in=pingtai_order_ids) & status_query
|
||||
orders = Order.query.filter(query).order_by('-create_time')
|
||||
orders = Order.query.filter(query).order_by('-CreateTime')
|
||||
#total_orders = orders.count()
|
||||
|
||||
# 手动分页逻辑
|
||||
@@ -2246,8 +2246,8 @@ class ShangjiaDingdanXiangqingView(APIView):
|
||||
'shensuliyou': fadan_obj.AppealReason or '',
|
||||
'tongyi_chufaliyou': fadan_obj.ApproveReason or '',
|
||||
'bohuiliyou': fadan_obj.RejectReason or '',
|
||||
'CreateTime': fadan_obj.create_time.strftime('%Y-%m-%d %H:%M:%S') if fadan_obj.create_time else '',
|
||||
'UpdateTime': fadan_obj.update_time.strftime('%Y-%m-%d %H:%M:%S') if fadan_obj.update_time else '',
|
||||
'CreateTime': fadan_obj.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if fadan_obj.CreateTime else '',
|
||||
'UpdateTime': fadan_obj.UpdateTime.strftime('%Y-%m-%d %H:%M:%S') if fadan_obj.UpdateTime else '',
|
||||
}
|
||||
|
||||
# 7. 商家自己的分红利率(用于罚款分红计算)
|
||||
@@ -2257,7 +2257,7 @@ class ShangjiaDingdanXiangqingView(APIView):
|
||||
last_fenhong = PenaltyBonus.query.filter(
|
||||
fenhongzhe_id=yonghuid,
|
||||
shenfen=1 # 1=商家
|
||||
).order_by('-create_time').first()
|
||||
).order_by('-CreateTime').first()
|
||||
if last_fenhong:
|
||||
fenhong_lilv = float(last_fenhong.IndividualRate or 0)
|
||||
except Exception as e:
|
||||
@@ -2995,7 +2995,7 @@ class DashouDingdanHuoquView(APIView):
|
||||
base_query &= Q(OrderID__in=list(biaoqian_order_ids))
|
||||
|
||||
# 4. 构建基础查询集
|
||||
base_qs = Order.query.filter(base_query).order_by('-create_time').distinct()
|
||||
base_qs = Order.query.filter(base_query).order_by('-CreateTime').distinct()
|
||||
|
||||
# 5. 获取总记录数
|
||||
total = base_qs.count()
|
||||
@@ -3746,7 +3746,7 @@ class DashouDingdanHuoquView1(APIView):
|
||||
query &= keyword_query
|
||||
|
||||
# 5. 执行查询,按创建时间倒序
|
||||
dingdan_query = Order.query.filter(query).order_by('-create_time')
|
||||
dingdan_query = Order.query.filter(query).order_by('-CreateTime')
|
||||
|
||||
# 只选择需要的字段,提高性能
|
||||
dingdan_query = dingdan_query.only(
|
||||
@@ -4211,7 +4211,7 @@ class DashouTijiaoView(APIView):
|
||||
OrderID=dingdan_id,
|
||||
PlayerID=yonghuid,
|
||||
ImageURL=tupian_url,
|
||||
create_time=timezone.now()
|
||||
CreateTime=timezone.now()
|
||||
)
|
||||
|
||||
# 6. 更新订单主表
|
||||
@@ -4552,7 +4552,7 @@ class AdGetDingdanXiangQing(APIView):
|
||||
# 查询该订单的退款记录(一个订单可能有多次退款申请,我们取最新的)
|
||||
tuikuan_record = RefundRecord.query.filter(
|
||||
OrderID=dingdan_id
|
||||
).order_by('-create_time').first() # 按创建时间倒序,取最新的
|
||||
).order_by('-CreateTime').first() # 按创建时间倒序,取最新的
|
||||
|
||||
if tuikuan_record and tuikuan_record.liyou:
|
||||
# 如果有退款记录且理由不为空,添加到返回数据
|
||||
@@ -5508,7 +5508,7 @@ class AdTongYiTuiKuanPingTai(APIView):
|
||||
laoban_id = dingdan_obj.pingtai_kuozhan.BossID
|
||||
|
||||
# 12. 调用微信退款接口(优先使用 wechat_transaction_id)
|
||||
transaction_id = getattr(dingdan_obj, 'wechat_transaction_id', None)
|
||||
transaction_id = getattr(dingdan_obj, 'WechatTransactionID', None)
|
||||
weixin_refund_result = self.call_weixin_refund(
|
||||
out_trade_no=dingdan_id,
|
||||
Amount=jine,
|
||||
@@ -6122,7 +6122,7 @@ class DashouXiugaiView(APIView):
|
||||
OrderID=dingdan_id,
|
||||
PlayerID=yonghuid,
|
||||
ImageURL=url,
|
||||
create_time=timezone.now()
|
||||
CreateTime=timezone.now()
|
||||
))
|
||||
Dashoutupian.objects.bulk_create(new_records)
|
||||
logger.info(f"订单 {dingdan_id} 新增图片 {len(new_records)} 张")
|
||||
|
||||
Reference in New Issue
Block a user