ZjSystemController.php 943 字节
<?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('保存成功');
            }
        }
    }

}