else {␊ |
// ID-based search␊ |
if (is_numeric($query)) {␊ |
$sql = new Pluf_SQL('project=%s AND CAST(id AS CHAR) LIKE %s', array($prj->id, $query.'%'));␊ |
$sql = 'project=%s AND CAST(id AS VARCHAR) LIKE %s';␊ |
// MySQL can't cast to VARCHAR and a CAST to CHAR converts␊ |
// the whole number, not just the first digit␊ |
if (strtolower(Pluf::f('db_engine')) == 'mysql') {␊ |
$sql = 'project=%s AND CAST(id AS CHAR) LIKE %s';␊ |
}␊ |
$sql = new Pluf_SQL($sql, array($prj->id, $query.'%'));␊ |
$tmp = Pluf::factory('IDF_Issue')->getList(array(␊ |
'filter' => $sql->gen(),␊ |
'order' => 'id ASC'␊ |