liyaozhi
2025-10-28 1320688354fd168c51cf2e05f29a2253f4ed9c00
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
<?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()?:'保存失败');
    }
}