liyaozhi
2025-10-29 52b7c373601edbc5010471082eb88dadf70e382d
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
<?php
 
namespace app\branch\controller\setting;
 
use app\branch\controller\Controller;
use app\branch\model\branch\Branch as BranchModel;
use app\common\model\settings\Region as RegionModel;
 
/**
 * 分会
 */
class Branch extends Controller
{
 
    /**
     * 修改信息
     */
    public function index(){
        $model = BranchModel::detail($this->getBranchId(), ['superUser.user']);
        if($this->request->isGet()){
            $areaList = RegionModel::getCacheTree();
            return $this->renderSuccess('', compact('model', 'areaList'));
        }
        if($model->edit($this->postData())){
            return $this->renderSuccess('操作成功', compact('model'));
        }
        return $this->renderError($model->getError()?:'保存失败');
    }
}