ArticleCategoryService.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Services\Content;
  3. use App\Repositories\ArticleCategoryRepository;
  4. class ArticleCategoryService
  5. {
  6. /**
  7. * @var ArticleCategoryRepository
  8. */
  9. protected $articleCategoryRepository;
  10. /**
  11. * ArticleCategoryService constructor.
  12. * @param ArticleCategoryRepository $articleCategoryRepository
  13. */
  14. public function __construct(ArticleCategoryRepository $articleCategoryRepository)
  15. {
  16. $this->articleCategoryRepository = $articleCategoryRepository;
  17. }
  18. public function getChildCategorys($id, $limit)
  19. {
  20. $where = [];
  21. $where['parent_id'] = $id;
  22. $list = $this->articleCategoryRepository->getChildCategorys($where, $limit);
  23. return $list;
  24. }
  25. public function getInfo($id)
  26. {
  27. $info = $this->articleCategoryRepository->getInfo($id);
  28. return $info;
  29. }
  30. public function getBread($id)
  31. {
  32. $list = $this->articleCategoryRepository->getBread($id);
  33. return $list;
  34. }
  35. }