ArticleCategoryController.php 670 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\api\controller\publics;
  3. use app\models\article\ArticleCategory;
  4. /**
  5. * 文章分类类
  6. * Class ArticleCategoryController
  7. * @package app\api\controller\publics
  8. */
  9. class ArticleCategoryController
  10. {
  11. /**
  12. * 文章分类列表
  13. * @return mixed
  14. * @throws \think\db\exception\DataNotFoundException
  15. * @throws \think\db\exception\ModelNotFoundException
  16. * @throws \think\exception\DbException
  17. */
  18. public function lst()
  19. {
  20. $cateInfo = ArticleCategory::getArticleCategory();
  21. if($cateInfo) $cateInfo = $cateInfo->toArray();
  22. else $cateInfo = [];
  23. return app('json')->successful($cateInfo);
  24. }
  25. }