Change return value of function agents_get_agent_id_by_alias when alias is ''

This commit is contained in:
Shinichi Matsumoto 2023-02-03 08:00:44 +00:00
parent 36b0fc9028
commit 9994477c06
1 changed files with 2 additions and 2 deletions

View File

@ -165,9 +165,9 @@ function agents_locate_agent(string $field)
function agents_get_agent_id_by_alias($alias, $is_metaconsole=false)
{
if ($is_metaconsole === true) {
return db_get_all_rows_sql("SELECT id_tagente FROM tmetaconsole_agent WHERE upper(alias) LIKE upper('%$alias%')");
return db_get_all_rows_sql("SELECT id_tagente FROM tmetaconsole_agent WHERE '$alias' != '' and upper(alias) LIKE upper('%$alias%')");
} else {
return db_get_all_rows_sql("SELECT id_agente FROM tagente WHERE upper(alias) LIKE upper('%$alias%')");
return db_get_all_rows_sql("SELECT id_agente FROM tagente WHERE '$alias' != '' and upper(alias) LIKE upper('%$alias%')");
}
}