系统模块对应控制器代码

Original 2019-02-26 21:23:06 237
abstract:<?php /**  * Created by PhpStorm.  * User: Administrator  * Date: 2019/2/26  * Time: 20:42  */ namespace app\admin\contro
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/2/26
 * Time: 20:42
 */

namespace app\admin\controller;

use app\admin\controller\Common;
use app\admin\model\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 doAdd()
    {
        $data = Request::param();

        $systemModel = new SystemModel();
        if($systemModel->isUpdate(true)->save($data)){
            return ['status'=>0,'msg'=>'保存成功'];
        }
    }
}


Correcting teacher:韦小宝Correction time:2019-02-27 09:16:17
Teacher's summary:写的很不错 系统模板中并没有太多的复杂的逻辑在里面

Release Notes

Popular Entries