integraçao site

This commit is contained in:
HalbeBruno
2025-12-17 12:33:42 -03:00
parent fca10b13c1
commit 72b7d8ccd7
572 changed files with 1646 additions and 27 deletions

View File

@@ -12,4 +12,18 @@ class Order extends Model
$stmt->execute();
return $stmt->fetchAll();
}
public function countAll()
{
$stmt = $this->conn->query("SELECT COUNT(*) as total FROM orders");
return $stmt->fetch()['total'];
}
public function countRecent($days = 7)
{
$stmt = $this->conn->prepare("SELECT COUNT(*) as total FROM orders WHERE created_at >= DATE_SUB(NOW(), INTERVAL :days DAY)");
$stmt->bindValue(':days', $days, \PDO::PARAM_INT);
$stmt->execute();
return $stmt->fetch()['total'];
}
}