| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\admin\controller;
- use app\BaseController;
- use app\common\model\AdminModel;
- use think\App;
- use think\facade\View;
- use think\Request;
- class Admin extends BaseController
- {
- private $model;
- public function __construct(App $app)
- {
- $this->model = new AdminModel();
- parent::__construct($app);
- }
- /**
- * @param Request $request
- * @return \think\response\View
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function index(Request $request)
- {
- $admins = $this->model->findAdmins();
- View::assign('admins', $admins);
- return view();
- }
- public function add()
- {
- return view();
- }
- }
|