作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

修改bug

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