chuweiqiang 1 年之前
父節點
當前提交
4b466bbdbc
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 2 2
      .idea/workspace.xml
  2. 3 3
      application/common/service/CheckPower.php

+ 2 - 2
.idea/workspace.xml

@@ -3,7 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Forum.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Forum.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/service/CheckPower.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/service/CheckPower.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -569,7 +569,7 @@
       <workItem from="1710722050864" duration="8908000" />
       <workItem from="1710808231575" duration="7017000" />
       <workItem from="1710817453185" duration="16334000" />
-      <workItem from="1710896140284" duration="9691000" />
+      <workItem from="1710896140284" duration="9856000" />
     </task>
     <servers />
   </component>

+ 3 - 3
application/common/service/CheckPower.php

@@ -54,7 +54,7 @@ class CheckPower
                     if(!$parent) return 0;
                 }
 
-                if($parent->type == 1)
+                if(isset($parent) && $parent->type == 1)
                 {
                     $cate = VideoCate::where('id','in',[$parent->first_classify,$parent->second_classify])
                         ->where('status',1)->where('is_deleted',0)->count();
@@ -74,7 +74,7 @@ class CheckPower
                     if (!$parent) return 0;
                 }
 
-                if($parent->type == 1)
+                if(isset($parent) && $parent->type == 1)
                 {
                     $cate = ArticleCate::where('id','in',[$parent->first_classify,$parent->second_classify])
                         ->where('status',1)->where('is_deleted',0)->count();
@@ -93,7 +93,7 @@ class CheckPower
                     $parent = DatumIntro::where('id', $first_id)->where('status', 1)->where('is_deleted', 0)->find();
                     if (!$parent) return 0;
                 }
-                if(!$parent->datum_cate) return 1;
+                if(isset($parent) && !$parent->datum_cate) return 1;
                 $cate = DatumCate::where('id','in',[$parent->datum_cate])
                     ->where('status',1)->where('is_deleted',0)->count();
                 //if($cate != 1) return 0;