panlumeng 3 years ago
parent
commit
7cae0d5830
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/admin/controller/Cat.php

+ 4 - 1
app/admin/controller/Cat.php

@@ -123,8 +123,11 @@ public function create()
         $level =$levl['level']+1;
     }
     $repeat_name = Db::name("cat")->where(["is_del"=>0,"cat_name"=>$cat_name])->find();
+    $int =isset($repeat_name['id']) && $repeat_name['id'] != 0 ? made($repeat_name['id']) : [];
+    $im = array_column($int,'name');
+    $in=implode('/',$im);
     if(!empty($repeat_name)){
-        return error_show(1004,"分类名称已在第{$level}组织存在");
+        return error_show(1004,"分类名称已在{$in}存在");
     }
     $specs_id = isset($this->post['specs_id']) && $this->post['specs_id'] !== "" ? $this->post['specs_id'] : [];
     if (empty($specs_id)) {