<?php namespace app\admin\controller; use app\admin\controller\Common; use think\Db; use think\facade\Request; class System extends Common { public function index() { //获取数据 $system=Db::table('system')->find(); $this->view->system=$system; return $this->fetch(); } public function edit() { $data=Request::param(); var_dump($data); if(Db::table('system')->where('id',$data['id'])->update([ 'site_name'=>$data['site_name'], 'about_title'=>$data['about_title'], 'about_content'=>$data['about_content'], 'pro_title'=>$data['pro_title'], 'pro_content'=>$data['pro_content'], 'xc_title'=>$data['xc_title'], 'xc_content'=>$data['xc_content'] ])){ return ['res'=>1,'msg'=>'修改成功']; }else{ return ['res'=>0,'msg'=>'修改失败']; } } }