亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

系統(tǒng)模板渲染,修改更新

Original 2019-05-28 21:39:43 240
abstrakt:<?php namespace app\admin\controller; use app\admin\controller\Common; use app\admin\model\SystemModel; use think\facade\Request; use think\facade\Session; class Syst
<?php
namespace app\admin\controller;
use app\admin\controller\Common;
use app\admin\model\SystemModel;
use think\facade\Request;
use think\facade\Session;

class System extends Common
{
public function index()
{
// 首頁(yè)查詢出數(shù)據(jù)
$res = SystemModel::all();
foreach($res as $val){
// 模板賦值
$this->view->assign('system',$val);
}
// 模板渲染
return $this->view->fetch();
}
public function edit()
{
// 系統(tǒng)更新
$data = Request::param();
$datas = [
'site_name' => $data['site_name'],
'about_title' => $data['about_title'],
'about_content' => $data['about_content'],
'com_int_title' => $data['com_int_title'],
'com_int_content' => $data['com_int_content'],
'com_x_title' => $data['com_x_title'],
'com_x_cont' => $data['com_x_cont'],
'time' => time(),
'username' => Session::get('username')
];
$res = SystemModel::where('id',1)->update($datas);
if($res){
return ['status' => 1,'msg' => '修改成功~~'];
}else{
return ['status' => 0,'msg' => '修改失敗!'];
}
}
}


Korrigierender Lehrer:查無(wú)此人Korrekturzeit:2019-05-29 13:15:19
Zusammenfassung des Lehrers:完成的不錯(cuò)。后臺(tái)cms管理系統(tǒng),就是對(duì)數(shù)據(jù)進(jìn)行操作。操作越簡(jiǎn)單越好。繼續(xù)加油。

Versionshinweise

Beliebte Eintr?ge