Department.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\admin\v1\work;
  12. use app\controller\admin\AuthController;
  13. use app\services\work\WorkDepartmentServices;
  14. use think\db\exception\DataNotFoundException;
  15. use think\db\exception\DbException;
  16. use think\db\exception\ModelNotFoundException;
  17. /**
  18. * 组织架构
  19. * Class Department
  20. * @package app\controller\admin\v1\work
  21. */
  22. class Department extends AuthController
  23. {
  24. /**
  25. * Department constructor.
  26. * @param WorkDepartmentServices $services
  27. */
  28. public function __construct(WorkDepartmentServices $services)
  29. {
  30. $this->services = $services;
  31. }
  32. /**
  33. * 获取组织架构
  34. * @return mixed
  35. * @throws DataNotFoundException
  36. * @throws DbException
  37. * @throws ModelNotFoundException
  38. */
  39. public function index()
  40. {
  41. return $this->success($this->services->getDepartmentList());
  42. }
  43. }