Parcourir la source

修复删除父规则节点时未删除子节点的BUG
修复CRUD默认index视图的错误

Karson il y a 8 ans
Parent
commit
3320cec110

+ 1 - 1
application/admin/command/Crud/stubs/index.stub

@@ -1,5 +1,5 @@
 <div class="panel panel-default panel-intro">
-    {:build_heading($heading.name, $heading.intro)}
+    {:build_heading()}
 
     <div class="panel-body">
         <div id="myTabContent" class="tab-content">

+ 7 - 1
application/admin/controller/auth/Rule.php

@@ -107,7 +107,13 @@ class Rule extends Backend
         $this->code = -1;
         if ($ids)
         {
-            $count = $this->model->where('id', 'in', $ids)->delete();
+            $delIds = [];
+            foreach (explode(',', $ids) as $k => $v)
+            {
+                $delIds = array_merge($delIds, Tree::instance()->getChildrenIds($v, TRUE));
+            }
+            $delIds = array_unique($delIds);
+            $count = $this->model->where('id', 'in', $delIds)->delete();
             if ($count)
             {
                 AdminLog::record(__('Del'), $ids);