better random book filter
This commit is contained in:
@@ -265,7 +265,14 @@ class NetBiblio extends WebService
|
||||
public function GetRandomBooks($number = 100) {
|
||||
$sql = "SELECT TOP $number NoticeId
|
||||
FROM Notices
|
||||
WHERE Notices.[NoticeNr] NOT LIKE '%%~%%'
|
||||
WHERE
|
||||
(
|
||||
Notices.MediaType1Code='CDD' OR
|
||||
Notices.MediaType1Code='CDA' OR
|
||||
Notices.MediaType1Code='CDS'
|
||||
)
|
||||
AND Notices.Visible=1
|
||||
AND Notices.[NoticeNr] NOT LIKE '%%~%%'
|
||||
ORDER BY NEWID();";
|
||||
$ids = Connection::execute($sql)->to_array();
|
||||
$ids = array_map(function($a) { return $a['NoticeId']; }, $ids);
|
||||
|
||||
Reference in New Issue
Block a user