function getChildrenIds ($sort_id)
{
$db = $this->loadDB();
$ids = '';
$sql = "SELECT * FROM t_dept WHERE `parent_id` = '{$sort_id}'";
$query = $db->query($sql);
$result = $query->result_array();
if ($result)
{
foreach ($result as $key=>$val)
{
$ids .= ','.$val['id'];
$ids .= $this->getChildrenIds ($val['id']);
}
}
return $ids;
}