From ebaf5f009fd609fca29d1135ee9ad9f27d489fc7 Mon Sep 17 00:00:00 2001 From: horus Date: Thu, 10 Nov 2022 23:20:29 +0100 Subject: search phrase fix 'und/oder' --- app/Http/Controllers/CocktailController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/Http/Controllers/CocktailController.php b/app/Http/Controllers/CocktailController.php index 9c5f096..c81f116 100644 --- a/app/Http/Controllers/CocktailController.php +++ b/app/Http/Controllers/CocktailController.php @@ -94,19 +94,22 @@ class CocktailController extends Controller $search_phrase = ""; foreach(array_filter($ingredients) as $term) { if ( $search_phrase != "" ) - $search_phrase = $search_phrase . " und "; + if ( Str::contains( $request->fullUrl(), 'oder' ) ) + $search_phrase = $search_phrase . " und/oder "; + else + $search_phrase = $search_phrase . " und "; $search_phrase = $search_phrase . ucwords($term); } - $search_phrase = rtrim($search_phrase, " und "); + #$search_phrase = rtrim($search_phrase, " und "); $exclude_phrase = ""; if ( isset($excludes) ) { foreach(array_filter($excludes) as $term) { if ( $exclude_phrase != "" ) - $exclude_phrase = $exclude_phrase . " und "; + $exclude_phrase = $exclude_phrase . " oder "; $exclude_phrase = $exclude_phrase . ucwords($term); } - $exclude_phrase = rtrim($exclude_phrase, " und "); + #$exclude_phrase = rtrim($exclude_phrase, " oder "); } if ( "" != $exclude_phrase) -- cgit v1.2.3