Commit 4287366a authored by Andreas Heimann's avatar Andreas Heimann

i love doctrine!

parent e7fd6066
......@@ -33,8 +33,8 @@ class SongRepository extends ServiceEntityRepository
$qb
->where('e.uploadDate <= :begin')
->andWhere('e.uploadDate >= :end')
->orderBy('e.downloads', 'DESC')
->addOrderBy('e.views', 'DESC')
->addOrderBy('e.downloads', 'DESC')
->setFirstResult(12 * $page)
->setMaxResults(12)
->setParameter('begin', new \DateTime('NOW'))
......@@ -45,8 +45,8 @@ class SongRepository extends ServiceEntityRepository
public function getPopular(int $page) {
$qb = $this->createQueryBuilder("e");
$qb
->orderBy('e.downloads', 'DESC')
->addOrderBy('e.views', 'DESC')
->addOrderBy('e.downloads', 'DESC')
->setFirstResult(12 * $page)
->setMaxResults(12);
return $qb->getQuery()->getResult();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment