完成品
This commit is contained in:
@@ -1976,7 +1976,7 @@ export class AppService {
|
||||
limit?: number;
|
||||
} = {}): Promise<{ apps: any[]; total: number }> {
|
||||
try {
|
||||
const { search = '', category = 'all', type = 'all', status = 'all', page = 1, limit = 10 } = filters;
|
||||
const { search = '', category = 'all', type = 'all', status = 'all', page = 1, limit = 5 } = filters;
|
||||
|
||||
// 構建查詢條件
|
||||
let whereConditions: string[] = [];
|
||||
@@ -2846,11 +2846,12 @@ export class AppService {
|
||||
const appStatsSql = `
|
||||
SELECT
|
||||
COUNT(*) as total_apps,
|
||||
COUNT(CASE WHEN is_active = TRUE THEN 1 END) as active_apps,
|
||||
COUNT(CASE WHEN is_active = FALSE THEN 1 END) as inactive_apps,
|
||||
COUNT(CASE WHEN created_at >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) THEN 1 END) as new_apps_this_month,
|
||||
COALESCE(SUM(views_count), 0) as total_views,
|
||||
COALESCE(SUM(likes_count), 0) as total_likes
|
||||
FROM apps
|
||||
WHERE is_active = TRUE
|
||||
FROM apps
|
||||
`;
|
||||
const appStats = await this.queryOne(appStatsSql);
|
||||
|
||||
@@ -2888,6 +2889,8 @@ export class AppService {
|
||||
totalUsers: userStats.totalUsers,
|
||||
activeUsers: userStats.activeUsers,
|
||||
totalApps: appStats?.total_apps || 0,
|
||||
activeApps: appStats?.active_apps || 0,
|
||||
inactiveApps: appStats?.inactive_apps || 0,
|
||||
totalCompetitions: competitionStats?.total_competitions || 0,
|
||||
totalReviews: reviewStats?.total_reviews || 0,
|
||||
totalViews: appStats?.total_views || 0,
|
||||
|
Reference in New Issue
Block a user