123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- declare (strict_types = 1);
- /**
- * +----------------------------------------------------------------------
- * | 管理员日志控制器
- * +----------------------------------------------------------------------
- */
- namespace app\sys\controller;
- // 引入框架内置类
- use think\facade\View;
- use app\common\model\System as SystemModel;
- class System extends Base
- {
- public function index()
- {
- $data = SystemModel::find(1);
- View::assign('data', $data);
- return View::fetch();
- }
- public function save($id = 0)
- {
- if ($this->request->isPost()) {
- $params = $this->request->param();
- try {
- SystemModel::update($params, ['id' => 1]);
- } catch (\Exception $e) {
- $msg = $e->getMessage();
- $this->error("错误提示:" . $msg);
- }
- $this->success('操作成功', 'sys/system/index');
- }
- }
- }
|