PHP 클래스 App\services\CategoryService

파일 보기 프로젝트 열기: qloog/laravel5-backend 1 사용 예제들

공개 메소드들

메소드 설명
getChilds ( $cate, integer $pid ) : array 根据父级分类id获得所有子分类id
getParents ( array $cate, integer $id ) : array 根据一个子分类id获取所有的父级分类 eg: 首页>衣服>女装>外套
unlimitedForLayer ( $cate, string $name = 'child', integer $pid ) : array 组合多维数组
unlimitedForLevel ( array $cate, string $html = '--', integer $pid, integer $level ) : array 组合一维数组

메소드 상세

getChilds() 공개 정적인 메소드

根据父级分类id获得所有子分类id
public static getChilds ( $cate, integer $pid ) : array
$cate
$pid integer
리턴 array

getParents() 공개 정적인 메소드

根据一个子分类id获取所有的父级分类 eg: 首页>衣服>女装>外套
public static getParents ( array $cate, integer $id ) : array
$cate array 分类数组
$id integer 当前分类id
리턴 array

unlimitedForLayer() 공개 정적인 메소드

组合多维数组
public static unlimitedForLayer ( $cate, string $name = 'child', integer $pid ) : array
$cate
$name string
$pid integer
리턴 array

unlimitedForLevel() 공개 정적인 메소드

组合一维数组
public static unlimitedForLevel ( array $cate, string $html = '--', integer $pid, integer $level ) : array
$cate array
$html string
$pid integer
$level integer
리턴 array