From 2281c9a534f8fc5a170ae9bbe3ee6637496583be Mon Sep 17 00:00:00 2001 From: Gilles Crettenand Date: Thu, 28 May 2015 10:34:59 +0200 Subject: [PATCH] do not get deleted books on random --- mobile.netbiblio.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile.netbiblio.php b/mobile.netbiblio.php index e59b86d..e93e973 100644 --- a/mobile.netbiblio.php +++ b/mobile.netbiblio.php @@ -263,7 +263,10 @@ class NetBiblio extends WebService } 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 = array_map(function($a) { return $a['NoticeId']; }, $ids); $books = AudioBook::findBy('NoticeId', $ids, true);