quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
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
49
50
51
52
53
<?php
 
namespace app\operations\controller\plus\business;
 
use app\operations\controller\Controller;
use app\operations\model\plus\business\Setting as BusinessSettingModel;
 
/**
 * 名片设置控制器
 */
class Setting extends Controller
{
    /**
     * 名片设置
     */
    public function index()
    {
        $data = BusinessSettingModel::getAll();
        return $this->renderSuccess('', compact('data'));
    }
 
    /**
     * 基础信息设置
     */
    public function basic()
    {
        $param = $this->postData();
        $data['basic'] = $param;
        return $this->edit($data);
    }
 
    /**
     * 页面背景设置
     */
    public function background()
    {
        $param = $this->postData();
        $data['background'] = $param;
        return $this->edit($data);
    }
 
    /**
     * 修改
     */
    public function edit($data)
    {
        $model = new BusinessSettingModel;
        if ($model->edit($data)) {
            return $this->renderSuccess('更新成功');
        }
        return $this->renderError($model->getError() ?: '更新失败');
    }
}