Explorar o código

🐛 fix(user): 修复推荐用户查询结果为空的问题
- 将getMany()替换为getRawMany()以正确获取原始查询结果

yourname hai 5 meses
pai
achega
f02a1c787b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/server/modules/users/user.service.ts

+ 1 - 1
src/server/modules/users/user.service.ts

@@ -178,7 +178,7 @@ export class UserService {
         .orderBy('user.created_at', 'DESC') // 按注册时间倒序,优先推荐新用户
         .take(limit);
 
-      return await query.getMany();
+      return await query.getRawMany();
     } catch (error) {
       console.error('Error getting recommended users:', error);
       throw new Error(`Failed to get recommended users: ${error instanceof Error ? error.message : String(error)}`)