Apply rules on lib dir

This commit is contained in:
Mike Jolley
2024-03-18 13:39:29 +00:00
committed by Jan Jakeš
parent 35fbac6320
commit 435f638011
159 changed files with 800 additions and 732 deletions

View File

@@ -60,7 +60,8 @@ class SubscribersEmailCountsController {
$initUpdateValue = $dateLastProcessed ? 's.email_count' : '';
$dateLastProcessedSql = $dateLastProcessed ? ' AND st.processed_at >= :dateFrom' : '';
$connection->executeQuery("
$connection->executeQuery(
"
UPDATE {$this->subscribersTable} as s
JOIN (
SELECT s.id, COUNT(st.id) as email_count
@@ -91,7 +92,8 @@ class SubscribersEmailCountsController {
$dayAgoIso = $dayAgo->subDay()->toDateTimeString();
$queryParams['dayAgo'] = $dayAgoIso;
$result = $this->entityManager->getConnection()->executeQuery("
$result = $this->entityManager->getConnection()->executeQuery(
"
SELECT count(id) FROM {$this->scheduledTasksTable}
WHERE type = 'sending'
AND processed_at IS NOT NULL
@@ -106,7 +108,8 @@ class SubscribersEmailCountsController {
}
private function countAndMaxOfSubscribersInRange(int $startId, int $batchSize): array {
$result = $this->entityManager->getConnection()->executeQuery("
$result = $this->entityManager->getConnection()->executeQuery(
"
SELECT COUNT(ids.id) as count, COALESCE(MAX(ids.id), 0) as max FROM (
SELECT s.id FROM {$this->subscribersTable} as s
WHERE s.id >= :startId