瀏覽代碼

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

Karson 8 年之前
父節點
當前提交
3320cec110
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 1 1
      application/admin/command/Crud/stubs/index.stub
  2. 7 1
      application/admin/controller/auth/Rule.php

+ 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);