Autosave: 20260328-025310
This commit is contained in:
parent
29a1863608
commit
5b05c65a86
@ -102,23 +102,13 @@ try {
|
||||
|
||||
// --- 3. Per-Outlet Stats ---
|
||||
// Fetch outlets dynamically from DB
|
||||
$stmtOutlets = $pdo->query("SELECT id, name FROM outlets WHERE is_deleted = 0 ORDER BY id ASC");
|
||||
$stmtOutlets = $pdo->query("SELECT id, name, name_ar FROM outlets WHERE is_deleted = 0 ORDER BY id ASC");
|
||||
$outlets = $stmtOutlets->fetchAll();
|
||||
cron_log("Fetched " . count($outlets) . " outlets from database.");
|
||||
|
||||
// Define excluded outlets (Demo data typically found in production databases seeded from dev)
|
||||
// You can add more names here if you want to hide them from the report
|
||||
$excludedOutlets = ['Main Downtown', 'Westside Hub', 'North Point Mall'];
|
||||
|
||||
foreach ($outlets as $outlet) {
|
||||
$outletId = $outlet['id'];
|
||||
$outletName = $outlet['name'];
|
||||
|
||||
// Skip excluded outlets
|
||||
if (in_array($outletName, $excludedOutlets)) {
|
||||
cron_log("Skipping excluded/demo outlet: " . $outletName);
|
||||
continue;
|
||||
}
|
||||
$outletName = !empty($outlet['name_ar']) ? $outlet['name_ar'] : $outlet['name'];
|
||||
|
||||
// Outlet Revenue
|
||||
$stmtRev = $pdo->prepare("SELECT SUM(total_amount) FROM orders WHERE outlet_id = ? AND created_at >= ? AND created_at <= ? AND status != 'cancelled'");
|
||||
|
||||
@ -21667,3 +21667,13 @@ Array
|
||||
[2026-03-26 23:59:02] Report sent successfully to 96897417667
|
||||
[2026-03-26 23:59:02] Sending detailed report to: 96899359472
|
||||
[2026-03-26 23:59:03] Report sent successfully to 96899359472
|
||||
[2026-03-27 23:59:01] Condition met: sending daily report for 2026-03-27
|
||||
[2026-03-27 23:59:01] Querying UTC Range: 2026-03-26 20:00:00 to 2026-03-27 19:59:59
|
||||
[2026-03-27 23:59:01] Fetched 4 outlets from database.
|
||||
[2026-03-27 23:59:01] Skipping excluded/demo outlet: Main Downtown
|
||||
[2026-03-27 23:59:01] Skipping excluded/demo outlet: Westside Hub
|
||||
[2026-03-27 23:59:01] Skipping excluded/demo outlet: North Point Mall
|
||||
[2026-03-27 23:59:01] Sending detailed report to: 96897417667
|
||||
[2026-03-27 23:59:02] Report sent successfully to 96897417667
|
||||
[2026-03-27 23:59:02] Sending detailed report to: 96899359472
|
||||
[2026-03-27 23:59:03] Report sent successfully to 96899359472
|
||||
|
||||
@ -1 +1 @@
|
||||
2026-03-26
|
||||
2026-03-27
|
||||
Loading…
x
Reference in New Issue
Block a user