1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 08:12:47 +01:00

Fix ricerca su sedi

This commit is contained in:
loviuz 2020-02-21 09:42:22 +01:00
parent d8ac21b232
commit b506ac2aad

View File

@ -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.'%');
}
}