|
|
|
@ -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);
|
|
|
|
|