public function empowerList(){
$sql="select ueid,pid,name,sort from userempower order by sort DESC,ueid ASC";
$datas=$this->db->getAll($sql);
$list = array();
if(!empty($datas)){
foreach($datas as $k=>$v){
$list[$v['pid']][] = $v;
}
}
return $list;
}
然后你在根据$list的结构组织一下页面显示就好了