#11537 Fix searchs
This commit is contained in:
parent
25175ce22e
commit
3bb4567dc3
|
@ -566,10 +566,10 @@ if ($search != '') {
|
||||||
if ($id != '') {
|
if ($id != '') {
|
||||||
$aux = $id[0]['id_agent'];
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = sprintf(
|
$search_sql = sprintf(
|
||||||
' AND ( nombre LIKE "%%%s%%"
|
' AND ( REPLACE(nombre, " ", " ") LIKE "%%%s%%"
|
||||||
OR alias LIKE "%%%s%%"
|
OR REPLACE(alias, " ", " ") LIKE "%%%s%%"
|
||||||
OR comentarios LIKE "%%%s%%"
|
OR REPLACE(comentarios, " ", " ") LIKE "%%%s%%"
|
||||||
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%")
|
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND REPLACE(description, " ", " ") LIKE "%%%s%%")
|
||||||
OR tagente.id_agente = %d',
|
OR tagente.id_agente = %d',
|
||||||
$search,
|
$search,
|
||||||
$search,
|
$search,
|
||||||
|
@ -591,10 +591,10 @@ if ($search != '') {
|
||||||
$search_sql .= ')';
|
$search_sql .= ')';
|
||||||
} else {
|
} else {
|
||||||
$search_sql = sprintf(
|
$search_sql = sprintf(
|
||||||
' AND ( nombre
|
' AND ( REPLACE(nombre, " ", " ")
|
||||||
LIKE "%%%s%%" OR alias
|
LIKE "%%%s%%" OR REPLACE(alias, " ", " ")
|
||||||
LIKE "%%%s%%" OR comentarios LIKE "%%%s%%"
|
LIKE "%%%s%%" OR REPLACE(comentarios, " ", " ") LIKE "%%%s%%"
|
||||||
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%"))',
|
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND REPLACE(description, " ", " ") LIKE "%%%s%%"))',
|
||||||
$search,
|
$search,
|
||||||
$search,
|
$search,
|
||||||
$search,
|
$search,
|
||||||
|
|
|
@ -574,7 +574,7 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente);
|
||||||
$search_string_entities = io_safe_input($search_string);
|
$search_string_entities = io_safe_input($search_string);
|
||||||
|
|
||||||
$basic_where = sprintf(
|
$basic_where = sprintf(
|
||||||
"(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND",
|
"(REPLACE(nombre, ' ', ' ') LIKE '%%%s%%' OR REPLACE(nombre, ' ', ' ') LIKE '%%%s%%' OR REPLACE(descripcion, ' ', ' ') LIKE '%%%s%%' OR REPLACE(descripcion, ' ', ' ') LIKE '%%%s%%') AND",
|
||||||
$search_string,
|
$search_string,
|
||||||
$search_string_entities,
|
$search_string_entities,
|
||||||
$search_string,
|
$search_string,
|
||||||
|
|
|
@ -729,7 +729,7 @@ if ($search_id_group) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_string != '') {
|
if ($search_string != '') {
|
||||||
$filter[] = '(name LIKE '."'%".$search_string."%'".'OR description LIKE '."'%".$search_string."%'".'OR tcp_send LIKE '."'%".$search_string."%'".'OR tcp_rcv LIKE '."'%".$search_string."%'".')';
|
$filter[] = '(REPLACE(name, " ", " ") LIKE '."'%".$search_string."%'".' OR REPLACE(REPLACE(description, " ", " "), " ", " ")LIKE '."'%".$search_string."%'".' OR REPLACE(tcp_send, " ", " ") LIKE '."'%".$search_string."%'".'OR REPLACE(tcp_rcv, " ", " ") LIKE '."'%".$search_string."%'".')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_components = network_components_get_network_components(
|
$total_components = network_components_get_network_components(
|
||||||
|
|
Loading…
Reference in New Issue