diff --git a/app/controller/admin/user/User.php b/app/controller/admin/user/User.php index 632272a..cc46d06 100644 --- a/app/controller/admin/user/User.php +++ b/app/controller/admin/user/User.php @@ -466,12 +466,15 @@ class User extends BaseController if (!$this->repository->exists($id)) return app('json')->fail('数据不存在'); $where = array(); - $where[] = array('agent_district_id' , '=', $agent_district_id); - $where[] = array('uid' , '<>', $id); - $exist = $this->repository->getWhere($where); - if($exist){ - return app('json')->fail('该代理已存在'); + if($agent_district_id){ + $where[] = array('agent_district_id' , '=', $agent_district_id); + $where[] = array('uid' , '<>', $id); + $exist = $this->repository->getWhere($where); + if($exist){ + return app('json')->fail('该代理已存在'); + } } + $this->repository->update($id, array('agent_district_id' => $agent_district_id, 'agent_district' => $agent_district)); return \app('json')->success('修改成功'); } diff --git a/public/system.html b/public/system.html index 1594aa3..42d2fdf 100644 --- a/public/system.html +++ b/public/system.html @@ -1,3 +1,3 @@ -