彻底解决了 create_time 的问题,将所有字段都改为了 CreateTime
This commit is contained in:
@@ -244,7 +244,7 @@ class ShenheDatingDataView(APIView):
|
||||
|
||||
total = query.count()
|
||||
offset = (page - 1) * page_size
|
||||
jilu_list = query.select_related('bankuai', 'chenghao').order_by('-create_time')[
|
||||
jilu_list = query.select_related('bankuai', 'chenghao').order_by('-CreateTime')[
|
||||
offset:offset + page_size]
|
||||
|
||||
records = []
|
||||
@@ -274,7 +274,7 @@ class ShenheDatingDataView(APIView):
|
||||
'chenghao_texiao_json': texiao_json,
|
||||
'guize_neirong': jl.guize_neirong or '',
|
||||
'kaohe_feiyong': kaohe_feiyong, # 新增
|
||||
'create_time': jl.create_time.strftime('%Y-%m-%d %H:%M:%S') if jl.create_time else '',
|
||||
'CreateTime': jl.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if jl.CreateTime else '',
|
||||
})
|
||||
|
||||
has_more = (page * page_size) < total
|
||||
@@ -416,7 +416,7 @@ class ShenheXiangqingView(APIView):
|
||||
last_fail = KaoheJujueJilu.objects.filter(
|
||||
jilu=jl,
|
||||
cishu=jl.cishu - 1
|
||||
).order_by('-create_time').first()
|
||||
).order_by('-CreateTime').first()
|
||||
if last_fail:
|
||||
last_fail_reason = last_fail.yuanyin
|
||||
|
||||
@@ -435,7 +435,7 @@ class ShenheXiangqingView(APIView):
|
||||
'daishou_fei': daishou_fei, # 新增:待收考核费
|
||||
'last_fail_reason': last_fail_reason,
|
||||
'is_jinpai': is_jinpai,
|
||||
'create_time': jl.create_time.strftime('%Y-%m-%d %H:%M:%S') if jl.create_time else '',
|
||||
'CreateTime': jl.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if jl.CreateTime else '',
|
||||
})
|
||||
|
||||
has_more = (page * page_size) < total
|
||||
@@ -685,7 +685,7 @@ class KaoheJiluView(APIView):
|
||||
)
|
||||
|
||||
total = query.count()
|
||||
records = query.order_by('-create_time')[(page-1)*page_size : page*page_size]
|
||||
records = query.order_by('-CreateTime')[(page-1)*page_size : page*page_size]
|
||||
|
||||
data = []
|
||||
for jl in records:
|
||||
@@ -695,7 +695,7 @@ class KaoheJiluView(APIView):
|
||||
)['total'] or 0.00
|
||||
|
||||
# 上次拒绝原因(最近一条)
|
||||
last_fail = KaoheJujueJilu.objects.filter(jilu=jl).order_by('-create_time').first()
|
||||
last_fail = KaoheJujueJilu.objects.filter(jilu=jl).order_by('-CreateTime').first()
|
||||
fail_reason = last_fail.yuanyin if last_fail else ''
|
||||
|
||||
# 考核官头像
|
||||
@@ -716,7 +716,7 @@ class KaoheJiluView(APIView):
|
||||
'cishu': jl.cishu,
|
||||
'total_fee': float(total_fee),
|
||||
'last_fail_reason': fail_reason,
|
||||
'create_time': jl.create_time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'CreateTime': jl.CreateTime.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
# 为再次申请预留标签对象数据(前端可能用到)
|
||||
'tag_obj': {
|
||||
'id': jl.chenghao_id,
|
||||
@@ -849,7 +849,7 @@ class KaoheJiluListView(APIView):
|
||||
# 4. 计数与分页
|
||||
total = base_query.count()
|
||||
offset = (page - 1) * page_size
|
||||
jilu_list = base_query.order_by('-create_time')[offset:offset + page_size]
|
||||
jilu_list = base_query.order_by('-CreateTime')[offset:offset + page_size]
|
||||
|
||||
# 5. 预取关联数据,减少查询次数
|
||||
jilu_list = jilu_list.select_related('bankuai', 'chenghao')
|
||||
@@ -875,7 +875,7 @@ class KaoheJiluListView(APIView):
|
||||
reject_dict[rej.jilu_id].append({
|
||||
'cishu': rej.cishu,
|
||||
'yuanyin': rej.yuanyin,
|
||||
'create_time': rej.create_time.strftime('%Y-%m-%d %H:%M:%S') if rej.create_time else ''
|
||||
'CreateTime': rej.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if rej.CreateTime else ''
|
||||
})
|
||||
|
||||
# 6. 批量获取申请人信息(昵称和头像)
|
||||
@@ -927,8 +927,8 @@ class KaoheJiluListView(APIView):
|
||||
'dashou_beizhu': jl.dashou_beizhu or '',
|
||||
'shenheguan_youxi_id': jl.shenheguan_youxi_id or '',
|
||||
'guize_neirong': jl.guize_neirong or '',
|
||||
'create_time': jl.create_time.strftime('%Y-%m-%d %H:%M:%S') if jl.create_time else '',
|
||||
'update_time': jl.update_time.strftime('%Y-%m-%d %H:%M:%S') if jl.update_time else '',
|
||||
'CreateTime': jl.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if jl.CreateTime else '',
|
||||
'UpdateTime': jl.UpdateTime.strftime('%Y-%m-%d %H:%M:%S') if jl.UpdateTime else '',
|
||||
'fee_list': fee_items,
|
||||
'reject_list': reject_dict.get(jl.jilu_id, []),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user