Fix: best method
This commit is contained in:
parent
6791d23032
commit
3abb1b88ff
@ -862,7 +862,16 @@ class Societe extends CommonObject
|
||||
if (! empty($name))
|
||||
{
|
||||
if (! $exact)
|
||||
$name = '%'.str_replace('*', '%', $name).'%';
|
||||
{
|
||||
if (preg_match('/^([\*]+)[^*]+([\*]+)$/', $name))
|
||||
{
|
||||
$name = str_replace('*', '%', $name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$name = '%'.$name.'%';
|
||||
}
|
||||
}
|
||||
$sql.= " AND ";
|
||||
if (is_array($filters) && ! empty($filters))
|
||||
$sql.= "(";
|
||||
@ -876,7 +885,16 @@ class Societe extends CommonObject
|
||||
foreach($filters as $field => $value)
|
||||
{
|
||||
if (! $exact)
|
||||
$value = str_replace('*', '%', $value);
|
||||
{
|
||||
if (preg_match('/^([\*]+)[^*]+([\*]+)$/', $value))
|
||||
{
|
||||
$value = str_replace('*', '%', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = '%'.$value.'%';
|
||||
}
|
||||
}
|
||||
if (! $case)
|
||||
$sql.= " ".$clause." ".$field." LIKE '".$this->db->escape($value)."'";
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user