do not get deleted books on random
This commit is contained in:
@@ -263,7 +263,10 @@ class NetBiblio extends WebService
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function GetRandomBooks($number = 100) {
|
public function GetRandomBooks($number = 100) {
|
||||||
$sql = "SELECT TOP $number NoticeId FROM Notices ORDER BY NEWID();";
|
$sql = "SELECT TOP $number NoticeId
|
||||||
|
FROM Notices
|
||||||
|
WHERE Notices.[NoticeNr] NOT LIKE '%%~%%'
|
||||||
|
ORDER BY NEWID();";
|
||||||
$ids = Connection::execute($sql)->to_array();
|
$ids = Connection::execute($sql)->to_array();
|
||||||
$ids = array_map(function($a) { return $a['NoticeId']; }, $ids);
|
$ids = array_map(function($a) { return $a['NoticeId']; }, $ids);
|
||||||
$books = AudioBook::findBy('NoticeId', $ids, true);
|
$books = AudioBook::findBy('NoticeId', $ids, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user