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:
parent
05b6a60caa
commit
dfe90eeb28
2 changed files with 8 additions and 1 deletions
|
|
@ -57,7 +57,10 @@ class DemoListProvider extends BaseProvider {
|
|||
->setMaxResults(50)
|
||||
->setFirstResult(((int) $page - 1) * 50);
|
||||
|
||||
$this->addWhere($query, $where);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue