AdminSetUpController.php
1.1 KB
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
40
41
42
43
44
45
46
47
48
<?php
/**
* Created by PhpStorm.
* User: ruidiudiu
* Date: 2018/11/14
* Time: 10:09
*/
namespace app\portal\controller;
use cmf\controller\AdminBaseController;
use think\Db;
/**
* Class AdminSetUpController
* @package app\portal\controller
* @adminMenuRoot(
* 'name' =>'参数设置',
* 'action' =>'index',
* 'parent' =>'',
* 'display'=> true,
* 'order' => 30,
* 'icon' =>'th',
* 'remark' =>'参数设置'
* )
*/
class AdminSetUpController extends AdminBaseController{
public function index(){
$data=Db::name('set_up')->where('id',1)->find();
$data['bill_rules']=html_entity_decode($data['bill_rules']);
$data['directions']=html_entity_decode($data['directions']);
$this->assign('setup',$data);
return $this->fetch();
}
public function setupPost(){
$param=$this->request->param();
$param['update_time']=time();
$res=Db::name('set_up')->where('id',1)->update($param);
if ($res){
$this->success('保存完成');
}else{
$this->error('保存失败');
}
}
}