...
|
...
|
@@ -40,13 +40,11 @@ class Category extends Api |
|
|
$tree = Tree::instance();
|
|
|
$tree->init(collection($list)->toArray(), 'pid');
|
|
|
$list = $this->getTreeList($tree->getTreeArray(0));
|
|
|
// 拼接全部分类,方便前端展示
|
|
|
// 拼接全部一级分类,方便前端展示
|
|
|
$all_list = [];
|
|
|
foreach($list as $v){
|
|
|
if($v['pid'] == 0){
|
|
|
$v['childlist'] = [];
|
|
|
$all_list[] = $v;
|
|
|
}
|
|
|
$v['childlist'] = [];
|
|
|
$all_list[] = $v;
|
|
|
}
|
|
|
$all = [
|
|
|
"id" => 0,
|
...
|
...
|
|