This commit is contained in:
Laurent Destailleur 2021-10-25 22:07:36 +02:00
parent f64cd9d859
commit 64ca5365e7

View File

@ -377,13 +377,13 @@ class Skilldet extends CommonObject
if ($key == 't.rowid') { if ($key == 't.rowid') {
$sqlwhere[] = $key.'='.$value; $sqlwhere[] = $key.'='.$value;
} elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; $sqlwhere[] = $key." = '".$this->db->idate($value)."'";
} elseif ($key == 'customsql') { } elseif ($key == 'customsql') {
$sqlwhere[] = $value; $sqlwhere[] = $value;
} elseif (strpos($value, '%') === false) { } elseif (strpos($value, '%') === false) {
$sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")";
} else { } else {
$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
} }
} }
} }
@ -395,7 +395,7 @@ class Skilldet extends CommonObject
$sql .= $this->db->order($sortfield, $sortorder); $sql .= $this->db->order($sortfield, $sortorder);
} }
if (!empty($limit)) { if (!empty($limit)) {
$sql .= ' '.$this->db->plimit($limit, $offset); $sql .= " ".$this->db->plimit($limit, $offset);
} }
$resql = $this->db->query($sql); $resql = $this->db->query($sql);