diff --git a/admin/controllers/sys/Addr.php b/admin/controllers/sys/Addr.php index 06f6e117..857ad764 100644 --- a/admin/controllers/sys/Addr.php +++ b/admin/controllers/sys/Addr.php @@ -169,7 +169,10 @@ class Addr extends HD_Controller{ return $this->show_json(SYS_CODE_FAIL, '请选行政区'); } - $where = array("title like '{$title}'" => null); + $where = array( + "title like '{$title}'" => null, + 'county_id' => $county_id + ); $count = $this->addr_model->count($where); if($count>0){ return $this->show_json(SYS_CODE_FAIL, '地址已存在'); @@ -217,7 +220,11 @@ class Addr extends HD_Controller{ return $this->show_json(SYS_CODE_FAIL, '请选行政区'); } - $where = array("title like '{$title}'" => null, "id<>{$info['id']}" => null); + $where = array( + "title like '{$title}'" => null, + "id<>{$info['id']}" => null, + 'county_id' => $county_id + ); $count = $this->addr_model->count($where); if($count>0){ return $this->show_json(SYS_CODE_FAIL, '地址已存在');