Category.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\controller\article;
  13. use app\api\controller\Controller;
  14. use app\api\model\article\Category as CategoryModel;
  15. /**
  16. * 文章分类
  17. * Class Category
  18. * @package app\api\controller\article
  19. */
  20. class Category extends Controller
  21. {
  22. /**
  23. * 文章分类列表
  24. * @return array
  25. * @throws \think\db\exception\DataNotFoundException
  26. * @throws \think\db\exception\DbException
  27. * @throws \think\db\exception\ModelNotFoundException
  28. */
  29. public function list()
  30. {
  31. $model = new CategoryModel;
  32. $list = $model->getShowList();
  33. return $this->renderSuccess(compact('list'));
  34. }
  35. }