Merge branch 'sprint/pailei_mayue_bug20175' into 'pailei'

* Optimize code.

See merge request easycorp/zentaopms!2028
This commit is contained in:
李玉春
2022-03-01 07:38:09 +00:00
+2 -2
View File
@@ -176,9 +176,9 @@ class searchModel extends model
if($operator == 'between' and !isset($this->config->search->dynamic[$value])) $operator = '=';
$condition = $operator . ' ' . $this->dbh->quote($value) . ' ';
if($operator == '=' and $this->post->$fieldName == 'id' and preg_match('/^[0-9]+(,[0-9]+)+$/', $value) and !preg_match('/[\x7f-\xff]+/', $value))
if($operator == '=' and $this->post->$fieldName == 'id' and preg_match('/^[0-9]+(,[0-9]*)+$/', $value) and !preg_match('/[\x7f-\xff]+/', $value))
{
$values = explode(',', trim($this->dbh->quote($value), "'"));
$values = array_filter(explode(',', trim($this->dbh->quote($value), "'")));
foreach($values as $value) $value = "'" . $value . "'";
$value = implode(',', $values);