fix correct display recent

This commit is contained in:
Jonas Heinrich 2020-11-15 23:13:29 +01:00
parent be069042ff
commit 4b80e8e8ed

View File

@ -23,7 +23,10 @@ class RecentMapper extends QBMapper {
public function find(int $id, string $userId): Station { public function find(int $id, string $userId): Station {
/* @var $qb IQueryBuilder */ /* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder(); $qb = $this->db->getQueryBuilder();
$qb->select('*') $qb->selectDistinct('stationuuid')
->addSelect('name')
->addSelect('favicon')
->addSelect('urlresolved')
->from('recent') ->from('recent')
->orderBy('id', 'DESC') ->orderBy('id', 'DESC')
->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))) ->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)))
@ -38,7 +41,10 @@ class RecentMapper extends QBMapper {
public function findAll(string $userId): array { public function findAll(string $userId): array {
/* @var $qb IQueryBuilder */ /* @var $qb IQueryBuilder */
$qb = $this->db->getQueryBuilder(); $qb = $this->db->getQueryBuilder();
$qb->select('*') $qb->selectDistinct('stationuuid')
->addSelect('name')
->addSelect('favicon')
->addSelect('urlresolved')
->from('recent') ->from('recent')
->orderBy('id', 'DESC') ->orderBy('id', 'DESC')
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));