ZxcZxc123 2 éve
szülő
commit
4a4d84fe63

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

@@ -40,7 +40,7 @@ class EducationModel extends Model
             }
         }
 
-        return $tree;
+        return app('json') -> success($tree);
     }
 
 //    public function getGrList($userId)

+ 4 - 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']])) {
@@ -33,7 +33,9 @@ class EducationController
             }
         }
 
-        return app('json')->success($tree);
+//        $data = array_values($tree);
+//        $msg = '获取分类成功';
+        return app('json') -> success($tree);
     }