From 3320cec110e7a3d187b8e58317bd5afc62ac9b60 Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 20 Apr 2017 22:02:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E7=88=B6?= =?UTF-8?q?=E8=A7=84=E5=88=99=E8=8A=82=E7=82=B9=E6=97=B6=E6=9C=AA=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=AD=90=E8=8A=82=E7=82=B9=E7=9A=84BUG=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DCRUD=E9=BB=98=E8=AE=A4index=E8=A7=86=E5=9B=BE=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/command/Crud/stubs/index.stub | 2 +- application/admin/controller/auth/Rule.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/application/admin/command/Crud/stubs/index.stub b/application/admin/command/Crud/stubs/index.stub index d251f661..f9ca18d2 100644 --- a/application/admin/command/Crud/stubs/index.stub +++ b/application/admin/command/Crud/stubs/index.stub @@ -1,5 +1,5 @@
- {:build_heading($heading.name, $heading.intro)} + {:build_heading()}
diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index 170902e6..b006bef7 100644 --- a/application/admin/controller/auth/Rule.php +++ b/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);