From d9bdd2b136a3e7624ffd1f175f01d8786544d53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 12 May 2014 22:15:51 +0200 Subject: [PATCH] Series can now be searched with normalized search. re #48, #49 --- serie.php | 10 +++++----- test/BaseWithSomeBooks/metadata.db | Bin 195584 -> 195584 bytes test/pageTest.php | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/serie.php b/serie.php index 31e113a..49885ef 100644 --- a/serie.php +++ b/serie.php @@ -74,13 +74,13 @@ order by series.sort'); } public static function getAllSeriesByQuery($query) { - $result = parent::getDb ()->prepare('select series.id as id, series.name as name, series.sort as sort, count(*) as count -from series, books_series_link -where series.id = series and series.name like ? + $columns = "series.id as id, series.name as name, series.sort as sort, count(*) as count"; + $sql = 'select {0} from series, books_series_link +where series.id = series and upper (series.name) like ? group by series.id, series.name, series.sort -order by series.sort'); +order by series.sort'; + list ($totalNumber, $result) = parent::executeQuery ($sql, $columns, "", array ('%' . $query . '%'), -1); $entryArray = array(); - $result->execute (array ('%' . $query . '%')); while ($post = $result->fetchObject ()) { $serie = new Serie ($post->id, $post->sort); diff --git a/test/BaseWithSomeBooks/metadata.db b/test/BaseWithSomeBooks/metadata.db index ca8af4280c47d01d4b779ed1668ed6b70bfec949..cc869580ef70b99cbd6aa91d894798a450e976a1 100644 GIT binary patch delta 834 zcmbu7T}V_>5XaBV+_hb`%+$ z7d%f9^^&56ddX8-VXe4D5>Y-_SsDgvh$uuX6xH2)@gaK&&cN^=&VSCF-?TVATAUso zdmz6v@HpfTp3lkwojQ>7-5+GNzp^yflXbE?>>adGHFYT=`bbrMk_?9Vm?$@Puyx{; z(mJ-Ee^|vdaqT5q0mF=n!5*f!Wk%~*Mu$nUID(XHdzy|hHW)oLet>lG`zRZf?6FWK z%i#yHirEpOiwmI)P`28Gz^L{*3Vgk(m`N1QXol|6RSKtYHAKIIQWA6$OHIwO_tsg= za=E!)K3i+8sI7@OV=B93HPtn2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