Admin.php 820 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\admin\controller;
  3. use app\BaseController;
  4. use app\common\model\AdminModel;
  5. use think\App;
  6. use think\facade\View;
  7. use think\Request;
  8. class Admin extends BaseController
  9. {
  10. private $model;
  11. public function __construct(App $app)
  12. {
  13. $this->model = new AdminModel();
  14. parent::__construct($app);
  15. }
  16. /**
  17. * @param Request $request
  18. * @return \think\response\View
  19. * @throws \think\db\exception\DataNotFoundException
  20. * @throws \think\db\exception\DbException
  21. * @throws \think\db\exception\ModelNotFoundException
  22. */
  23. public function index(Request $request)
  24. {
  25. $admins = $this->model->findAdmins();
  26. View::assign('admins', $admins);
  27. return view();
  28. }
  29. public function add()
  30. {
  31. return view();
  32. }
  33. }