ZjSystemController.php
943 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Created by PhpStorm.
* User: wz
* Date: 2018/9/20
* Time: 14:39
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
class ZjSystemController extends AdminBaseController
{
public function index(){
$one=Db::name('zj_system')->find();
$this->assign('one',$one);
return $this->fetch();
}
public function edit(){
if ($this->request->param()){
$arr=input('param.');
if (empty($arr['about_img'])){
$this->error('关于我们页背景图不可为空');
}
$arr['about']=htmlspecialchars(cmf_replace_content_file_url(htmlspecialchars_decode($arr['about'])));
$up=Db::name('zj_system')->update($arr);
if (empty($up)){
$this->error('保存失败');
}else{
$this->success('保存成功');
}
}
}
}