|
@@ -76,6 +76,10 @@ public function create()
|
|
|
if ($cat_name == "") {
|
|
|
return error_show(1002, "参数cat_name不能为空");
|
|
|
}
|
|
|
+ $repeat_name = Db::name("cat")->where(["is_del"=>0,"cat_name"=>$cat_name])->find();
|
|
|
+ if(!empty($repeat_name)){
|
|
|
+ return error_show(1004,"分类名称已存在");
|
|
|
+ }
|
|
|
$pid = isset($this->post['pid']) && $this->post['pid'] !== "" ? intval($this->post['pid']) : "";
|
|
|
if ($pid === "") {
|
|
|
return error_show(1002, "参数pid不能为空");
|