liche update for admin sys addr unrepeat at county

This commit is contained in:
xxb
2021-09-26 11:11:23 +08:00
parent 278740c87d
commit eb8fdd6e06
+9 -2
View File
@@ -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, '地址已存在');