Fix daily_summary dan hourly_summary aggregation, tambah fallback logic untuk dashboard, update validator untuk camera dan location type

This commit is contained in:
mwpn
2025-12-18 11:13:06 +07:00
parent 9416de7d87
commit d05fa2f4cd
31 changed files with 2041 additions and 45 deletions

29
bin/check_dates.php Normal file
View File

@@ -0,0 +1,29 @@
<?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";
}