1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

allow searching by cleaned map name

This commit is contained in:
Robin Appelman 2017-09-12 17:47:21 +02:00
commit 7a68627054
2 changed files with 8 additions and 5 deletions

View file

@ -60,7 +60,10 @@ class DemoListProvider extends BaseProvider {
->leftJoin('d', 'upload_blacklist', 'b', $query->expr()->eq('uploader_id', 'uploader'))
->where($query->expr()->isNull('b.id'));
if (isset($where['map'])) {
$query->where($query->expr()->eq('map', $query->createNamedParameter($where['map'])));
$query->where($query->expr()->orX(
$query->expr()->eq('clean_map_name(map)', $query->createNamedParameter($where['map'])),
$query->expr()->eq('map', $query->createNamedParameter($where['map']))
));
}
if (isset($where['playerCount'])) {
$query->where($query->expr()->in('"playerCount"',