From b506ac2aad4c0b1ad97893d1852d6b3c22015f32 Mon Sep 17 00:00:00 2001 From: loviuz Date: Fri, 21 Feb 2020 09:42:22 +0100 Subject: [PATCH] Fix ricerca su sedi --- modules/anagrafiche/ajax/select.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/anagrafiche/ajax/select.php b/modules/anagrafiche/ajax/select.php index af52d75b5..0db94105d 100755 --- a/modules/anagrafiche/ajax/select.php +++ b/modules/anagrafiche/ajax/select.php @@ -226,7 +226,7 @@ switch ($resource) { case 'sedi': if (isset($superselect['idanagrafica'])) { - $query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione"; + $query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab HAVING descrizione LIKE ".prepare('%'.$search.'%')." ORDER BY descrizione"; foreach ($elements as $element) { $filter[] = 'id='.prepare($element); @@ -235,7 +235,6 @@ switch ($resource) { $where[] = 'idanagrafica='.prepare($superselect['idanagrafica']); if (!empty($search)) { - $search_fields[] = 'nomesede LIKE '.prepare('%'.$search.'%'); $search_fields[] = 'citta LIKE '.prepare('%'.$search.'%'); } }