wugg 2 years ago
parent
commit
25559ba97a
2 changed files with 5 additions and 7 deletions
  1. 4 6
      app/admin/controller/Cat.php
  2. 1 1
      app/admin/controller/Platform.php

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

@@ -277,10 +277,9 @@ public function create()
                 Db::rollback();
                 return error_show(1005, "新建失败");
             }
-            if($level==3){
+
                 $catinfo=['cat_id'=>$datainfo,'apply_name'=>$creater,"apply_id"=>$createrid,"fund_code"=>$fund_code,"status"=>0];
                 $this->addPlat($catinfo);
-            }
            Db::commit();
             return error_show(0, "新建成功");
         } else {
@@ -427,10 +426,9 @@ public function edit(){
                 }
             }
             $itn =sear($id);
-              if($level==3){
+
                 $catinfo=['cat_id'=>$id,'apply_name'=>$creater,"apply_id"=>$createrid,"fund_code"=>$fund_code,"status"=>$idinfo['status']];
                 $this->addPlat($catinfo);
-            }
             Db::commit();
             return error_show(0,"编辑成功");
         }else{
@@ -573,10 +571,10 @@ public function status(){
     $it['updatetime']=date("Y-m-d H:i:s");
     $str = Db::name('cat')->where(['id'=>$cat,'is_del'=>0])->save($it);
     if($str){
-        if($stn['level']==3){
+
                 $catinfo=['cat_id'=>$id,"status"=>$status];
                 $this->addPlat($catinfo);
-            }else{
+            if (!empty($cat)){
                 $catinfo=['cat_id'=> $cat,"status"=>$status];
                 $this->addPlat($catinfo);
             }

+ 1 - 1
app/admin/controller/Platform.php

@@ -240,7 +240,7 @@ class Platform extends Base
 
      /** 平台添加分类 **/
     private  function  addPlat($plat_id){
-        $cat =Db::name("cat")->where(["status"=>1,"is_del"=>0,"level"=>3])->select()->toArray();
+        $cat =Db::name("cat")->where(["status"=>1,"is_del"=>0])->select()->toArray();
         if (empty($cat)){
             return '';
         }