| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\admin\controller;
- use app\BaseController;
- use app\common\model\ConfigModel;
- use think\App;
- use think\facade\View;
- class Config extends BaseController
- {
- private $model;
- public function __construct(App $app)
- {
- $this->model = new ConfigModel();
- parent::__construct($app);
- }
- public function index() {
- $config = $this->model->findById(1);
- if ($this->request->isAjax()) {
- $this->model->where('id', 1)->update($this->request->param());
- return $this->ok(true);
- }
- View::assign('config', $config);
- return view();
- }
- }
|