递归处理
/**
* 获得子分类
* @param $category
* @param int $parent_id
* @return array
*/
public function getSonCategory($category, $parent_id=0){
$arr = array();
foreach ($category as $key=>$value){
if ($value['parent_id'] == $parent_id){
// $arr[] = $value;
// $this->getSonCategory($category,$value['category_id']);
$value['son'] = $this->getSonCategory($category,$value['category_id']);
$arr[] = $value;
}
}
return $arr;
}