|
|
|
@ -310,7 +310,7 @@ class NetBiblio extends WebService
|
|
|
|
if (isset($queryArray['queryType'])) {
|
|
|
|
if (isset($queryArray['queryType'])) {
|
|
|
|
$bs->addSortField('author', SolrQuery::ORDER_ASC);
|
|
|
|
$bs->addSortField('author', SolrQuery::ORDER_ASC);
|
|
|
|
$bs->addSortField('title', SolrQuery::ORDER_ASC);
|
|
|
|
$bs->addSortField('title', SolrQuery::ORDER_ASC);
|
|
|
|
$bs->addSortField('producer');
|
|
|
|
$bs->addSortField('producerCode');
|
|
|
|
$bs->addSortField('mediaType', SolrQuery::ORDER_ASC);
|
|
|
|
$bs->addSortField('mediaType', SolrQuery::ORDER_ASC);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$bs->addSortField('availabilityDate');
|
|
|
|
$bs->addSortField('availabilityDate');
|
|
|
|
@ -323,15 +323,15 @@ class NetBiblio extends WebService
|
|
|
|
$bs->addQuery($queryArray['queryText'], $type);
|
|
|
|
$bs->addQuery($queryArray['queryText'], $type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($queryArray['category']) && is_array($queryArray['category'])) {
|
|
|
|
if(isset($queryArray['genre']) && is_array($queryArray['genre'])) {
|
|
|
|
$selectedCategories = array_filter($queryArray['category'], function ($c) {
|
|
|
|
$selectedGenres = array_filter($queryArray['genre'], function ($c) {
|
|
|
|
return $c != '0';
|
|
|
|
return $c != '0';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (count($selectedCategories) > 0) {
|
|
|
|
if (count($selectedGenres) > 0) {
|
|
|
|
$selectedCategories = array_map(function ($c) {
|
|
|
|
$selectedGenres = array_map(function ($c) {
|
|
|
|
return 'categoryCode:'.SolrUtils::escapeQueryChars($c);
|
|
|
|
return 'genreCode:'.SolrUtils::escapeQueryChars($c);
|
|
|
|
}, $selectedCategories);
|
|
|
|
}, $selectedGenres);
|
|
|
|
$bs->addQuery('('.implode(' OR ', $selectedCategories).')', null, false);
|
|
|
|
$bs->addQuery('('.implode(' OR ', $selectedGenres).')', null, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -354,10 +354,7 @@ class NetBiblio extends WebService
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($results['response']['docs'] as $doc) {
|
|
|
|
foreach ($results['response']['docs'] as $doc) {
|
|
|
|
$book = AudioBook::findBy('NoticeID', $doc['id'], true);
|
|
|
|
$data[] = $this->AddFiles($doc);
|
|
|
|
if($book) {
|
|
|
|
|
|
|
|
$data[] = $this->AddFiles($book);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
return $data;
|
|
|
|
@ -368,9 +365,9 @@ class NetBiblio extends WebService
|
|
|
|
return AudioBook::listOfReaders();
|
|
|
|
return AudioBook::listOfReaders();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function ListOfCategories()
|
|
|
|
public function ListOfGenres()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return AudioBook::listOfCategories();
|
|
|
|
return AudioBook::ListOfGenres();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function ListOfTypes()
|
|
|
|
public function ListOfTypes()
|
|
|
|
@ -393,7 +390,7 @@ class NetBiblio extends WebService
|
|
|
|
if($type == 'Jeunesse') {
|
|
|
|
if($type == 'Jeunesse') {
|
|
|
|
$s->addQuery(1, 'jeunesse');
|
|
|
|
$s->addQuery(1, 'jeunesse');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$s->addQuery($type, 'category');
|
|
|
|
$s->addQuery($type, 'genre');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$s->addSortField('availabilityDate');
|
|
|
|
$s->addSortField('availabilityDate');
|
|
|
|
|
|
|
|
|
|
|
|
|