瀏覽代碼

Optimisation recherche de tag: requete sql prend en compte les "-", ",", ", "

bastien 13 年之前
父節點
當前提交
1cdc28644c
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/Muzich/CoreBundle/Controller/SearchController.php

+ 6 - 1
src/Muzich/CoreBundle/Controller/SearchController.php 查看文件

@@ -379,7 +379,12 @@ class SearchController extends Controller
379 379
     {
380 380
       if (strlen($string_search) > 1)
381 381
       {
382
-        $words = explode(' ', $string_search);
382
+        $words = array_merge(
383
+          explode(' ', $string_search),
384
+          explode('-', $string_search),
385
+          explode(',', $string_search),
386
+          explode(', ', $string_search)
387
+        );
383 388
         $where = '';
384 389
         $params = array();
385 390
         foreach ($words as $i => $word)