From 13ba0056da32415288bce0a5cd80302bf7757696 Mon Sep 17 00:00:00 2001 From: Thomas Rubini <74205383+ThomasRubini@users.noreply.github.com> Date: Thu, 26 Jan 2023 13:24:43 +0100 Subject: [PATCH 1/2] Fix recipe search query --- Models/RecipeModel.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Models/RecipeModel.php b/Models/RecipeModel.php index 3909728..c75a6aa 100644 --- a/Models/RecipeModel.php +++ b/Models/RecipeModel.php @@ -193,13 +193,12 @@ final class RecipeModel -- get a row per occurrence and sort by occurrences number select RECIPE.* - 1 AS NOTE from CTE JOIN RECIPE WHERE CTE.NAME is not null AND INSTR(RECIPE.NAME, CTE.NAME) > 0 GROUP BY RECIPE.ID - ORDER BY count(RECIPE.ID) DESCR + ORDER BY count(RECIPE.ID) LIMIT 10; "); From 0f8a113583edc75855a991280b400271cb1abf6e Mon Sep 17 00:00:00 2001 From: Thomas Rubini <74205383+ThomasRubini@users.noreply.github.com> Date: Thu, 26 Jan 2023 13:25:43 +0100 Subject: [PATCH 2/2] fix recipe/search view call --- Views/recipe/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Views/recipe/search.php b/Views/recipe/search.php index ad55967..054b399 100644 --- a/Views/recipe/search.php +++ b/Views/recipe/search.php @@ -22,7 +22,7 @@ echo '

Assurez-vous d\'avoir rentré correctement vos termes de recherche ou essayez des mots clefs différents.

'; } else { foreach ($search_results as $key => $value) { - View::show("common/recipe", $value); + View::show("common/recipe", array("RECIPE" => $value)); } } }