Depart.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * ----------------------------------------------------------------------------
  4. * 行到水穷处,坐看云起时
  5. * 开发软件,找贵阳云起信息科技,官网地址:https://www.56q7.com/
  6. * ----------------------------------------------------------------------------
  7. * Author: 老成
  8. * email:85556713@qq.com
  9. */
  10. declare(strict_types=1);
  11. namespace app\admin\controller\auth;
  12. use app\admin\traits\Actions;
  13. use app\common\controller\Backend;
  14. use app\common\model\Department;
  15. use think\annotation\route\Group;
  16. use think\annotation\route\Route;
  17. /**
  18. * 部门管理
  19. */
  20. #[Group("auth/depart")]
  21. class Depart extends Backend
  22. {
  23. private $departdata;
  24. use Actions;
  25. public function _initialize()
  26. {
  27. parent::_initialize();
  28. $this->model=new Department();
  29. $this->departdata=Department::getDepartData();
  30. $this->assign('departdata',$this->departdata);
  31. }
  32. #[Route('GET,JSON','index')]
  33. public function index()
  34. {
  35. if (false === $this->request->isAjax()) {
  36. return $this->fetch();
  37. }
  38. $result = ['total' => 1000, 'rows' =>$this->departdata];
  39. return json($result);
  40. }
  41. }