panlumeng 3 years ago
parent
commit
6d5e887f5f
2 changed files with 7 additions and 4 deletions
  1. 1 0
      app/admin/controller/Cat.php
  2. 6 4
      app/common.php

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

@@ -406,6 +406,7 @@ public function edit(){
                     return error_show(1002, "编辑失败");
                 }
             }
+            $itn =sear($id);
             Db::commit();
             return error_show(0,"编辑成功");
         }else{

+ 6 - 4
app/common.php

@@ -402,14 +402,16 @@ function sear($id){
        return false;
     }else{
         $temp = Db::name('cat')->where(['pid'=>$id,'is_del'=>0])->select();
+        if ($temp==false){
+            return false;
+        }
     }
-    $var =[];
     foreach ($temp as $value){
         $value['search']=$item['search']."_".$value['cat_name'];
-        $var[]=$value;
+
+        $list = Db::name('cat')->save($value);
+         sear($id);
     }
-    $list = Db::name('cat')->save($var);
-    return sear($id);
 }
 
 function manger($list=[],$level=1){