Admin.php 736 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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\DbException
  20. */
  21. public function index(Request $request)
  22. {
  23. View::assign([
  24. 'list' => $this->model->findByPaginate()
  25. ]);
  26. return view();
  27. }
  28. public function add()
  29. {
  30. return view();
  31. }
  32. }