<?php
|
|
namespace app\operations\controller\plus\vip;
|
|
use app\operations\controller\Controller;
|
use app\operations\model\plus\vip\Setting as VipSettingModel;
|
|
/**
|
* VIP专区设置控制器
|
*/
|
class Setting extends Controller
|
{
|
public $pay_type = [
|
['id' => '10', 'name' => '微信支付'],
|
['id' => '20', 'name' => '支付宝'],
|
['id' => '30', 'name' => '银行卡']
|
];
|
|
/**
|
* VIP专区设置
|
*/
|
public function index()
|
{
|
$pay_type = $this->pay_type;
|
$data = VipSettingModel::getAll();
|
return $this->renderSuccess('', compact('data', 'pay_type'));
|
}
|
|
/**
|
* 基础信息设置
|
*/
|
public function basic()
|
{
|
$param = $this->postData();
|
$data['basic'] = $param;
|
return $this->edit($data);
|
}
|
|
/**
|
* 结算设置
|
*/
|
public function settlement()
|
{
|
$param = $this->postData();
|
$data['settlement'] = $param;
|
return $this->edit($data);
|
}
|
|
/**
|
* 文字设置
|
*/
|
public function words()
|
{
|
$param = $this->postData();
|
$data['words'] = $param;
|
return $this->edit($data);
|
}
|
|
/**
|
* 背景图设置
|
*/
|
public function background()
|
{
|
$param = $this->postData();
|
$data['background'] = $param;
|
return $this->edit($data);
|
}
|
|
/**
|
* 修改
|
*/
|
public function edit($data)
|
{
|
$model = new VipSettingModel;
|
if ($model->edit($data)) {
|
return $this->renderSuccess('更新成功');
|
}
|
return $this->renderError($model->getError() ?: '更新失败');
|
}
|
}
|