ZxcZxc123 2 years ago
parent
commit
1359c9fa47
2 changed files with 6 additions and 6 deletions
  1. 5 5
      app/model/api/EducationModel.php
  2. 1 1
      app/system/controller/Index.php

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

@@ -9,11 +9,11 @@ use think\Model;
     */
 class EducationModel extends Model
     {
-//    // 设置当前模型对应的数据表名称
-//    protected $name = 'table_education_cate';
-//
-//    // 设置当前模型的数据库连接
-//    protected $connection = 'infant_service';
+    // 设置当前模型对应的数据表名称
+    protected $name = 'table_education_cate';
+
+    // 设置当前模型的数据库连接
+    protected $connection = 'infant_service';
 
     /**
      * 当前所在模块的CSS样式类

+ 1 - 1
app/system/controller/Index.php

@@ -51,7 +51,7 @@ class Index extends AuthController
     //获取所有分类列表
     public function getCateList()
     {
-        $cateList = EducationModel::select();
+        $cateList = EducationModel::getCate();
         return json($cateList);
     }
 }