修复了部分问题
This commit is contained in:
@@ -2947,7 +2947,7 @@ class GetGuanliListView(APIView):
|
||||
|
||||
# 分页
|
||||
offset = (page - 1) * page_size
|
||||
users = qs.order_by('-create_time')[offset:offset + page_size]
|
||||
users = qs.order_by('-UserCreateTime')[offset:offset + page_size]
|
||||
|
||||
# 构建返回数据
|
||||
result = []
|
||||
|
||||
@@ -2459,10 +2459,10 @@ class AdminFinancialDataView(APIView):
|
||||
# 使用高效的ORM查询,避免额外的数据库查询
|
||||
try:
|
||||
# 使用select_related一次性获取管理员扩展表
|
||||
# 注意:这里假设user_type='admin'的用户都有admin_profile
|
||||
# UserType 是 @property 非数据库字段,用 AdminProfile__isnull=False 替代
|
||||
yonghu_xiangxi = User.query.select_related('AdminProfile').get(
|
||||
pk=dangqianyonghu.pk,
|
||||
user_type='admin'
|
||||
AdminProfile__isnull=False
|
||||
)
|
||||
|
||||
# 检查管理员扩展表是否存在
|
||||
|
||||
Reference in New Issue
Block a user