<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/5/27
* Time: 22:54
*/
namespace app\admin\controller;
use app\admin\controller\Common;
use app\model\System as SystemModel;
use think\facade\Request;
class System extends Common
{
public function index()
{
$system = SystemModel::get(1);
$this->assign('system',$system);
//渲染系统设置页面
return $this->fetch();
}
public function doEdit()
{
//获取提交的数据
$data = Request::param();
$result = SystemModel::where('id',$data['id'])->update($data);
if ($result) {
return ['res'=>1,'msg'=>'保存成功'];
} else {
return ['res'=>0,'msg'=>'保存失败'];
}
}
}