wugg 2 年之前
父節點
當前提交
3e4dd67a2c
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/admin/controller/CatPlat.php

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

@@ -298,7 +298,8 @@ use think\App;class CatPlat extends Base{
         $plat_id=isset($this->post['platform_id']) && $this->post['platform_id'] !==""? intval($this->post['platform_id']) :"";
         if($pid!==""){
             $where[]=["pid","=",$pid];
-            $pcat =  Db::name('cat')->where(['id'=>$pid,"is_del"=>0])->find();
+          if ($pid!=0){
+               $pcat =  Db::name('cat')->where(['id'=>$pid,"is_del"=>0])->find();
             if($pcat==false){
                 return error_show(1004,"未找到分类数据");
             }else{
@@ -308,6 +309,8 @@ use think\App;class CatPlat extends Base{
                    }
                 }
             }
+          }
+
         }
         if($plat_id!=""){
               $platform = Db::name("platform")->where(["id"=>$plat_id,"is_del"=>0])->find();