From cf3ca26382064eb5eddb970a75ab3455c746245e Mon Sep 17 00:00:00 2001 From: Tiago Ramos <2222055@my.ipleiria.pt> Date: Tue, 30 Dec 2025 19:17:49 +0000 Subject: [PATCH] removed comments on code --- api/app/Http/Controllers/StatisticsController.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/app/Http/Controllers/StatisticsController.php b/api/app/Http/Controllers/StatisticsController.php index c43baad..d0d529b 100644 --- a/api/app/Http/Controllers/StatisticsController.php +++ b/api/app/Http/Controllers/StatisticsController.php @@ -81,13 +81,11 @@ class StatisticsController extends Controller $totalGames = Game::count(); $totalBlockedUsers = User::where('blocked', true)->count(); - // 2. Games Breakdown by Type $gamesByType = Game::select('type', DB::raw('count(*) as total')) ->groupBy('type') ->get(); - // 3. Games Per Month (CORRIGIDO PARA SQLITE) - // SQLite usa strftime('%Y-%m', coluna) em vez de DATE_FORMAT + $gamesPerMonth = Game::select( DB::raw("strftime('%Y-%m', began_at) as month"), DB::raw('count(*) as total') @@ -98,13 +96,11 @@ class StatisticsController extends Controller ->limit(12) ->get(); - // 4. Financial/Coin Stats $totalCoinsPurchased = \App\Models\CoinTransaction::whereHas('type', function($q) { $q->where('name', 'Coin purchase'); }) ->sum('coins'); - // Calculate Purchases Per Month (CORRIGIDO PARA SQLITE) $purchasesPerMonth = \App\Models\CoinTransaction::join('coin_transaction_types', 'coin_transactions.coin_transaction_type_id', '=', 'coin_transaction_types.id') ->where('coin_transaction_types.name', 'Coin purchase') ->select(