返回小型企业站系统......登陆

小型企业站系统设置模块

12019-06-16 10:09:12278

<?php

namespace app\admin\controller;

use think\Controller;

use app\admin\model\User;

use app\admin\model\Sort;

use app\admin\model\System;

use think\facade\Session;

use think\facade\Request;

use app\admin\controller\Commn;


class Systeml extends Commn

{

public function index()

{

$res = System::all();


$this->assign('res',$res);


return $this->fetch();

}

public function add()

{

return $this->fetch();

}

public function add_do()

{

$data = Request::param();


if ($res = System::insert($data)) {

return json(['code'=>1,'msg'=>'添加设置成功']);

}else{

return json(['code'=>2,'msg'=>'添加设置失败']);

}

}

public function del()

{

$data = Request::param();


$id = $data['id'];


if ($res = System::where('id',$id)->delete()) {

return json(['code'=>0,'msg'=>'删除设置成功']);

}else{

return json(['code'=>1,'msg'=>'删除设置失败']);

}

}

}


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送
  • php.cn