Commit c7ae60bb authored by hujun's avatar hujun

部门编辑修改

parent 32afdf2e
......@@ -59,17 +59,24 @@ class District extends Basic
* @throws \think\exception\PDOException
*/
public function addDistrict () {
if ($this->params['department_name'] || $this->params['agents_id']) {
$district = new ADistrict();
if ($this->request->isPost()) {
$district = new ADistrict();
if ($this->request->isPost()) {
if ($this->params['department_name'] || $this->params['agents_id']) {
$this->data = $district->addDepartmentAgents($this->params, $this->params['agents_id']);
} else {
$this->data = $district->getDistrictById($this->params['id']);
$this->code = 101;
$this->msg = 'department or district is null';
}
} else {
$this->code = 101;
$this->msg = 'department or district is null';
if ($this->params['id']) {
$this->data = $district->getDistrictById($this->params['id']);
} else {
$this->code = 101;
$this->msg = 'id is null';
}
}
return $this->response($this->code, $this->msg, $this->data);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment