<?php
|
|
namespace app\branch\controller\setting;
|
|
use app\branch\controller\Controller;
|
use app\branch\model\branch\Service as ServiceModel;
|
use app\branch\model\settings\Setting as SettingModel;
|
use app\branch\model\branch\Branch as BranchModel;
|
/**
|
* 分会客服
|
*/
|
class Service extends Controller
|
{
|
/**
|
* 修改信息
|
*/
|
public function index(){
|
$model = ServiceModel::detail($this->getBranchId());
|
if($this->request->isGet()){
|
$model['service_open'] = SettingModel::getSysConfig()['service_open'];
|
$Branch = BranchModel::detail($this->getBranchId(), []);
|
$model['user_id'] = $Branch['user_id'];
|
return $this->renderSuccess('', compact('model'));
|
}
|
if(ServiceModel::saveService($this->getBranchId(), $this->postData())){
|
return $this->renderSuccess('操作成功');
|
}
|
return $this->renderError($model->getError()?:'保存失败');
|
}
|
}
|