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

fix searching by player and other

This commit is contained in:
Robin Appelman 2020-11-28 16:20:22 +01:00
commit dfe90eeb28
2 changed files with 8 additions and 1 deletions

View file

@ -57,7 +57,10 @@ class DemoListProvider extends BaseProvider {
->setMaxResults(50)
->setFirstResult(((int) $page - 1) * 50);
if (count($where)) {
$query->innerJoin('p', 'demos', 'd', $query->expr()->eq('demo_id', 'd.id'));
$this->addWhere($query, $where);
}
$result = $query->execute();
$demoIds = $result->fetchAll(PDO::FETCH_COLUMN);

View file

@ -179,6 +179,10 @@ class DemoListProviderTest extends TestCase {
['players' => [$steamId2->getSteamId64(), $steamId3->getSteamId64()]]);
$this->assertCount(0, $list);
$list = $this->demoListProvider->listDemos(1, ['players' => [$steamId1->getSteamId64()], 'map' => 'map1']);
$this->assertCount(1, $list);
$this->assertEquals($id1, $list[0]->getId());
}
public function testByUploaderFilterBackend() {