30 lines
954 B
PHP
30 lines
954 B
PHP
|
|
<?php
|
||
|
|
require __DIR__ . '/../vendor/autoload.php';
|
||
|
|
|
||
|
|
use App\Config\AppConfig;
|
||
|
|
use App\Support\Database;
|
||
|
|
|
||
|
|
AppConfig::loadEnv(__DIR__ . '/..');
|
||
|
|
|
||
|
|
$db = Database::getConnection(
|
||
|
|
AppConfig::get('DB_HOST'),
|
||
|
|
AppConfig::get('DB_NAME'),
|
||
|
|
AppConfig::get('DB_USER'),
|
||
|
|
AppConfig::get('DB_PASS')
|
||
|
|
);
|
||
|
|
|
||
|
|
echo "=== Dates with entry_events data ===\n";
|
||
|
|
$stmt = $db->query('SELECT DATE(event_time) as date, COUNT(*) as count FROM entry_events GROUP BY DATE(event_time) ORDER BY date DESC LIMIT 10');
|
||
|
|
$results = $stmt->fetchAll();
|
||
|
|
foreach ($results as $row) {
|
||
|
|
echo $row['date'] . ' - ' . $row['count'] . ' events' . "\n";
|
||
|
|
}
|
||
|
|
|
||
|
|
echo "\n=== Dates with daily_summary data ===\n";
|
||
|
|
$stmt = $db->query('SELECT summary_date, SUM(total_count) as total FROM daily_summary GROUP BY summary_date ORDER BY summary_date DESC LIMIT 10');
|
||
|
|
$results = $stmt->fetchAll();
|
||
|
|
foreach ($results as $row) {
|
||
|
|
echo $row['summary_date'] . ' - ' . $row['total'] . ' total' . "\n";
|
||
|
|
}
|
||
|
|
|