Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 68d7f9ef66 | |||
| 9668a455f3 |
@@ -11,6 +11,7 @@ use Contao\ModuleModel;
|
|||||||
use Contao\StringUtil;
|
use Contao\StringUtil;
|
||||||
use Doctrine\DBAL\ArrayParameterType;
|
use Doctrine\DBAL\ArrayParameterType;
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
|
use Doctrine\DBAL\ParameterType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
@@ -48,29 +49,25 @@ class EventFilterController extends AbstractFrontendModuleController
|
|||||||
<<<'SQL'
|
<<<'SQL'
|
||||||
SELECT e.id
|
SELECT e.id
|
||||||
FROM tl_calendar_events e
|
FROM tl_calendar_events e
|
||||||
INNER JOIN tl_calendar c ON c.id=e.pid
|
|
||||||
WHERE e.published='1'
|
WHERE e.published='1'
|
||||||
AND c.published='1'
|
|
||||||
AND (e.startTime>=? OR e.endTime>=?)
|
AND (e.startTime>=? OR e.endTime>=?)
|
||||||
ORDER BY e.startTime ASC
|
ORDER BY e.startTime ASC
|
||||||
SQL,
|
SQL,
|
||||||
[$today, $today],
|
[$today, $today],
|
||||||
[\PDO::PARAM_INT, \PDO::PARAM_INT],
|
[ParameterType::INTEGER, ParameterType::INTEGER],
|
||||||
)->fetchFirstColumn();
|
)->fetchFirstColumn();
|
||||||
} else {
|
} else {
|
||||||
$rows = $this->connection->executeQuery(
|
$rows = $this->connection->executeQuery(
|
||||||
<<<'SQL'
|
<<<'SQL'
|
||||||
SELECT e.id
|
SELECT e.id
|
||||||
FROM tl_calendar_events e
|
FROM tl_calendar_events e
|
||||||
INNER JOIN tl_calendar c ON c.id=e.pid
|
|
||||||
WHERE e.pid IN (?)
|
WHERE e.pid IN (?)
|
||||||
AND e.published='1'
|
AND e.published='1'
|
||||||
AND c.published='1'
|
|
||||||
AND (e.startTime>=? OR e.endTime>=?)
|
AND (e.startTime>=? OR e.endTime>=?)
|
||||||
ORDER BY e.startTime ASC
|
ORDER BY e.startTime ASC
|
||||||
SQL,
|
SQL,
|
||||||
[$calendarIds, $today, $today],
|
[$calendarIds, $today, $today],
|
||||||
[ArrayParameterType::INTEGER, \PDO::PARAM_INT, \PDO::PARAM_INT],
|
[ArrayParameterType::INTEGER, ParameterType::INTEGER, ParameterType::INTEGER],
|
||||||
)->fetchFirstColumn();
|
)->fetchFirstColumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user