|
|
@@ -20,6 +20,9 @@ use app\Request;
|
|
|
use app\system\controller\AuthController;
|
|
|
use library\services\UtilService;
|
|
|
use think\Cache;
|
|
|
+use think\db\exception\DataNotFoundException;
|
|
|
+use think\db\exception\DbException;
|
|
|
+use think\db\exception\ModelNotFoundException;
|
|
|
|
|
|
|
|
|
class Index extends AuthController
|
|
|
@@ -51,7 +54,12 @@ class Index extends AuthController
|
|
|
//获取所有分类列表
|
|
|
public function getCateList()
|
|
|
{
|
|
|
- $cateList = EducationModel::getCate();
|
|
|
+ try {
|
|
|
+ $cateList = (new \app\model\api\EducationModel)->select();
|
|
|
+ } catch (DataNotFoundException $e) {
|
|
|
+ } catch (ModelNotFoundException $e) {
|
|
|
+ } catch (DbException $e) {
|
|
|
+ }
|
|
|
return json($cateList);
|
|
|
}
|
|
|
}
|