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