摘要:<?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\
/**
* 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'=>'保存失败'];
}
}
}
批改老师:天蓬老师批改时间:2019-05-28 17:01:10
老师总结:代码很精简, 不错, 功能 实现的也是正确 的.....