ZxcZxc123 2 vuotta sitten
vanhempi
commit
0b3bb40871

+ 2 - 2
app/model/api/EducationModel.php

@@ -30,7 +30,7 @@ class EducationModel extends Model
             ->order('sort', 'asc')
             ->column('id,pid,name,sort', 'id');
 
-        $tree = [] ;
+        $tree = array();
         foreach ($items as $key => $item) {
             $items[$key]['oriName'] = $item['name'];
             if (isset ($items [$item ['pid']])) {
@@ -40,7 +40,7 @@ class EducationModel extends Model
             }
         }
 
-        return app('json') -> success($tree);
+        return app('json') -> success($items);
     }
 
 //    public function getGrList($userId)

+ 2 - 2
app/system/controller/EducationController.php

@@ -23,7 +23,7 @@ class EducationController
             ->order('sort', 'asc')
             ->column('id,pid,name,sort', 'id');
 
-        $tree = []; //格式化好的树
+        $tree = array(); //格式化好的树
         foreach ($items as $key => $item) {
             $items[$key]['oriName'] = $item['name'];
             if (isset($items[$item['pid']])) {
@@ -35,7 +35,7 @@ class EducationController
 
 //        $data = array_values($tree);
 //        $msg = '获取分类成功';
-        return app('json') -> success($tree);
+        return app('json') -> success($items);
     }