完成 APP 建立流程和使用分析、增加主機備機的備援機制、管理者後臺增加資料庫監控
This commit is contained in:
@@ -14,24 +14,19 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const users = await userService.query(sql);
|
||||
|
||||
// 為每個用戶獲取統計數據
|
||||
const usersWithStats = await Promise.all(
|
||||
users.map(async (user) => {
|
||||
const stats = await userService.getUserAppAndReviewStats(user.id);
|
||||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
department: user.department,
|
||||
role: user.role,
|
||||
status: user.status,
|
||||
createdAt: user.created_at,
|
||||
lastLogin: user.last_login,
|
||||
appCount: stats.appCount,
|
||||
reviewCount: stats.reviewCount
|
||||
};
|
||||
})
|
||||
);
|
||||
// 格式化用戶數據
|
||||
const usersWithStats = users.map((user) => {
|
||||
return {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
department: user.department,
|
||||
role: user.role,
|
||||
status: user.status,
|
||||
createdAt: user.created_at,
|
||||
lastLogin: user.last_login
|
||||
};
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
|
Reference in New Issue
Block a user