mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-12 22:48:06 +02:00
Massive escrow update; also fixes #3
This commit is contained in:
parent
28c68a4e57
commit
42ddc29df6
2 changed files with 289 additions and 98 deletions
|
@ -42,8 +42,16 @@ function setupLogger($logFilePath, $channelName = 'app') {
|
|||
}
|
||||
|
||||
function fetchCount($pdo, $tableName) {
|
||||
$stmt = $pdo->prepare("SELECT count(id) AS count FROM {$tableName};");
|
||||
// Calculate the end of the previous day
|
||||
$endOfPreviousDay = date('Y-m-d 23:59:59', strtotime('-1 day'));
|
||||
|
||||
// Prepare the SQL query
|
||||
$query = "SELECT COUNT(id) AS count FROM {$tableName} WHERE crdate <= :endOfPreviousDay";
|
||||
$stmt = $pdo->prepare($query);
|
||||
$stmt->bindParam(':endOfPreviousDay', $endOfPreviousDay);
|
||||
$stmt->execute();
|
||||
|
||||
// Fetch and return the count
|
||||
$result = $stmt->fetch();
|
||||
return $result['count'];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue