git-svn-id: https://msi/svn/firstRepo/Service/branches/Manut_2.2.3@87 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
+4
-2
@@ -56,7 +56,8 @@ $app->get('/ricette/:catID', function ($categoryID) use ($app) {
|
||||
$mysqlconnetion = new MysqlClass;
|
||||
//$mysqlconnetion->connetti();
|
||||
$query = "select * from (select ID as ricetta_id, titolo, autore, valutazione, difficolta, " .
|
||||
"(select id from immagini where immagini.id_ricette = ricette.id and bCover = 1) as firstImage " .
|
||||
"(select id from immagini where immagini.id_ricette = ricette.id and bCover = 1) as firstImage, " .
|
||||
"(select count(id) from immagini where immagini.id_ricette = ricette.id) as countImages " .
|
||||
"from ricette where ricette.ID_CATEGORIA = " . $categoryID . " order by titolo, autore) as TMP";
|
||||
$retObj = $mysqlconnetion->queryToObject($query);
|
||||
$mysqlconnetion->disconnetti();
|
||||
@@ -122,7 +123,8 @@ $app->get('/ricette/search/:numItems/:startItem(/:categoryId(/:difficolta/:autor
|
||||
$queryBase = $queryBase . " order by titolo, autore";
|
||||
|
||||
$query = "select * from (select ricette.ID as ricetta_id, categorie.name AS categoria_name, titolo, autore, valutazione, difficolta, " .
|
||||
"(select id from immagini where immagini.id_ricette = ricette.id and bCover = 1) as firstImage" .
|
||||
"(select id from immagini where immagini.id_ricette = ricette.id and bCover = 1) as firstImage, " .
|
||||
"(select count(id) from immagini where immagini.id_ricette = ricette.id) as countImages" .
|
||||
$queryBase . " LIMIT " . $numItems * $startItem . " , " . $numItems . ") as TMP";
|
||||
|
||||
$retObj2 = $mysqlconnetion->queryToObject($query);
|
||||
|
||||
Reference in New Issue
Block a user