Fixed speaker filter

Change-Id: I73b60f99578edcf7d23fe593abf651b85545c7b2
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
smarcet 2020-10-30 15:06:36 -03:00
parent 655256f9cd
commit 4a80c42350
3 changed files with 6 additions and 4 deletions

View File

@ -476,12 +476,11 @@ final class Filter
* @param array $mappings
* @return string
*/
public function toRawSQL(array $mappings)
public function toRawSQL(array $mappings, int $param_idx = 1)
{
$sql = '';
$this->bindings = [];
$param_prefix = "param_%s";
$param_idx = 1;
foreach ($this->filters as $filter) {
if ($filter instanceof FilterElement) {

View File

@ -368,7 +368,7 @@ SQL;
$where_event_conditions = $filter->toRawSQL([
'event_start_date' => 'E.StartDate:datetime_epoch',
'event_end_date' => 'E.EndDate:datetime_epoch',
]);
], count($bindings) + 1);
if(!empty($where_event_conditions)) {
$extra_events_filters = " AND {$where_event_conditions}";

View File

@ -503,7 +503,10 @@ final class OAuth2SpeakersApiTest extends ProtectedApiTest
'id' => $summit_id,
'page' => 1,
'per_page' => 10,
'filter' => ['featured==true']
'filter' => [
'event_start_date>=1604304000',
'event_end_date<=1604390399'
]
];
$headers = [