function getSpecialSortAttrs($isCommon = 0, $cid = 0) { $sorting = new Sorting($this); $sortAttrs = $sorting->getAttrs(); $s = ""; foreach ($sortAttrs as $attr) { CustomField::getSortType($sortType, $sortSqlAttr, $isCommon, $cid, $attr); if ($sortType == customfield_integer) { $s .= ", 0+{$sortSqlAttr} AS {$attr}"; } elseif ($sortType == customfield_float) { $s .= ", 0.0+{$sortSqlAttr} AS {$attr}"; } elseif ($sortType == customfield_date) { $s .= ", IFNULL(CAST({$sortSqlAttr} AS DATE), '') AS {$attr}"; } } return $s; }