<?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() ?: '更新失败');
|
}
|
}
|