Fix daily_summary dan hourly_summary aggregation, tambah fallback logic untuk dashboard, update validator untuk camera dan location type
This commit is contained in:
29
bin/check_dates.php
Normal file
29
bin/check_dates.php
Normal 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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user