Commit 3152c383 authored by Andreas Heimann's avatar Andreas Heimann

added publication status to search

parent 29f9bcd3
...@@ -26,7 +26,7 @@ class SearchController extends AbstractController ...@@ -26,7 +26,7 @@ class SearchController extends AbstractController
$resultsSongs = []; $resultsSongs = [];
if($request->query->get('showAll') == "1") { if($request->query->get('showAll') == "1") {
$resultsSongs = $em->getRepository(Song::class)->findBy(array(), array('id' => 'DESC')); $resultsSongs = $em->getRepository(Song::class)->findBy(array('publicationStatus' => array(0, 1)), array('id' => 'DESC'));
$data['results']['users'] = $resultsUsers; $data['results']['users'] = $resultsUsers;
$data['results']['songs'] = $resultsSongs; $data['results']['songs'] = $resultsSongs;
...@@ -41,7 +41,8 @@ class SearchController extends AbstractController ...@@ -41,7 +41,8 @@ class SearchController extends AbstractController
$resultsSongs = $em->getRepository(Song::class)->createQueryBuilder('o') $resultsSongs = $em->getRepository(Song::class)->createQueryBuilder('o')
->where('o.title LIKE :query') ->where('o.publicationStatus IN (0, 1)')
->andWhere('o.title LIKE :query')
->orWhere('o.subtitle LIKE :query') ->orWhere('o.subtitle LIKE :query')
->orWhere('o.tags LIKE :query') ->orWhere('o.tags LIKE :query')
->orWhere('o.artist LIKE :query') ->orWhere('o.artist LIKE :query')
......
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