彻底解决了 create_time 的问题,将所有字段都改为了 CreateTime

This commit is contained in:
2026-06-19 19:19:22 +08:00
parent 90e0bde7f1
commit e64697b64a
35 changed files with 4803 additions and 4872 deletions

View File

@@ -1038,7 +1038,7 @@ class GetAdminZhanghaoView(APIView):
LEFT JOIN xiugaijilu xjl ON um.phone = xjl.xiugaiid
WHERE um.UserType = 'admin'
GROUP BY um.id, um.phone, um.yonghuid, um.UserType
ORDER BY um.create_time DESC
ORDER BY um.CreateTime DESC
"""
cursor.execute(sql)
@@ -1194,12 +1194,12 @@ class GetXiugaiJiluView(APIView):
xjl.huiyuants, -- IntegerField
xjl.huiyuan_id, -- CharField
xjl.qitashuoming, -- TextField
xjl.create_time, -- DateTimeField
xjl.CreateTime, -- DateTimeField
um.avatar -- CharField
FROM xiugaijilu xjl
LEFT JOIN user_main um ON xjl.yonghuid = um.yonghuid
WHERE xjl.xiugaiid = %s
ORDER BY xjl.create_time DESC
ORDER BY xjl.CreateTime DESC
LIMIT %s OFFSET %s
"""
@@ -1390,7 +1390,7 @@ class ShangjiaMobanListView(APIView):
'labelId': moban.TitleID,
'labelName': label_name,
'texiaoJson': texiao_json,
'createTime': moban.create_time.strftime('%Y-%m-%d %H:%M:%S') if moban.create_time else ''
'createTime': moban.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if moban.CreateTime else ''
})
return Response({'code': 200, 'msg': '搜索成功', 'data': {'list': formatted, 'total': len(formatted), 'hasMore': False}})
@@ -1423,7 +1423,7 @@ class ShangjiaMobanListView(APIView):
'labelId': moban.TitleID,
'labelName': label_name,
'texiaoJson': texiao_json,
'createTime': moban.create_time.strftime('%Y-%m-%d %H:%M:%S') if moban.create_time else ''
'createTime': moban.CreateTime.strftime('%Y-%m-%d %H:%M:%S') if moban.CreateTime else ''
})
has_more = current_page.has_next()
@@ -1561,7 +1561,7 @@ class ShangjiaTianjiaMobanView(APIView):
'jieshao': moban.TemplateDesc,
'jiage': str(moban.Price),
'fabushuliang': moban.PublishedCount,
'createTime': moban.create_time.strftime('%Y-%m-%d %H:%M:%S'),
'createTime': moban.CreateTime.strftime('%Y-%m-%d %H:%M:%S'),
'commissionEnabled': moban.CommissionGrabEnabled,
'commissionValue': str(moban.CommissionPrice) if moban.CommissionPrice is not None else None,
'labelId': moban.TitleID
@@ -1730,7 +1730,7 @@ class ShangjiaGengxinMobanView(APIView):
'commissionEnabled': moban.CommissionGrabEnabled,
'commissionValue': str(moban.CommissionPrice) if moban.CommissionPrice else None,
'labelId': moban.TitleID,
'updateTime': moban.update_time.strftime('%Y-%m-%d %H:%M:%S')
'updateTime': moban.UpdateTime.strftime('%Y-%m-%d %H:%M:%S')
}
})
@@ -1947,7 +1947,7 @@ class ShangjiaLianjieListView(APIView):
UserID=yonghu_id,
TemplateID=moban_id,
is_used=(used == 1)
).order_by('-create_time')
).order_by('-CreateTime')
paginator = Paginator(links, page_size)
if page < 1 or page > paginator.num_pages:
@@ -1963,7 +1963,7 @@ class ShangjiaLianjieListView(APIView):
'is_used': link.is_used,
'dingdan_id': link.OrderID,
'ExpireTime': link.ExpireTime.strftime('%Y-%m-%d %H:%M:%S') if link.ExpireTime else '',
'create_time': link.create_time.strftime('%Y-%m-%d %H:%M:%S')
'CreateTime': link.CreateTime.strftime('%Y-%m-%d %H:%M:%S')
})
return Response({
@@ -2581,7 +2581,7 @@ class KehuTianxieDingdanView(APIView):
# 14. 返回成功响应
response_data = {
#'dingdan_id': dingdan_obj.dingdan_id,
#'create_time': dingdan_obj.create_time.strftime('%Y-%m-%d %H:%M:%S'),
#'CreateTime': dingdan_obj.CreateTime.strftime('%Y-%m-%d %H:%M:%S'),
#'shangpin_mingcheng': dingdan_obj.jieshao[:50] if dingdan_obj.jieshao else '', # 截取前50字符
#'jiage': str(dingdan_obj.jine) if dingdan_obj.jine else '0.00',
'shangjia_mingcheng': shangjia_mingcheng,
@@ -2714,8 +2714,8 @@ class GuanZhuAListView(APIView):
# 获取所有图片的相对URL
images = list(qs.values_list('ImageURL', flat=True))
# 获取最新更新时间(取所有记录的update_time最大值
last_update = qs.aggregate(update_time__max=Max('update_time'))['update_time__max']
# 获取最新更新时间(取所有记录的UpdateTime最大值
last_update = qs.aggregate(UpdateTime__max=Max('UpdateTime'))['UpdateTime__max']
last_update_str = last_update.strftime('%Y-%m-%d %H:%M:%S') if last_update else None
# 原子性增加访问次数