diff --git a/backend/view.py b/backend/view.py index b40cc4e..fe10864 100644 --- a/backend/view.py +++ b/backend/view.py @@ -800,7 +800,7 @@ class KefuGetDashouDetailView(APIView): # 4. 查询打手主表和扩展表 try: user_main = User.query.select_related('dashou_profile').get( - yonghuid=uid + UserUID=uid ) except User.DoesNotExist: return Response({'code': 404, 'msg': '打手不存在'}) @@ -957,7 +957,7 @@ class KefuGetDashouDetailView(APIView): try: # 使用 select_related 预加载 dashou_profile,减少数据库查询 user_main = User.query.select_related('dashou_profile').get( - yonghuid=uid + UserUID=uid ) except User.DoesNotExist: return Response({'code': 404, 'msg': '打手不存在'}, status=status.HTTP_404_NOT_FOUND) @@ -2888,7 +2888,7 @@ class GetGuanliListView(APIView): # 关键词搜索(用户ID 或 昵称来自 boss_profile.nickname) if keyword: qs = qs.filter( - Q(yonghuid__icontains=keyword) | + Q(UserUID__icontains=keyword) | Q(boss_profile__nickname__icontains=keyword) )