From bc71a3e2d1c54c125c993e62259782ec5967ea85 Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Tue, 27 Nov 2018 21:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=BB=84=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/auth/Group.php | 2 +- application/admin/controller/auth/Rule.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/admin/controller/auth/Group.php b/application/admin/controller/auth/Group.php index 1f573b81..f1d12bf4 100644 --- a/application/admin/controller/auth/Group.php +++ b/application/admin/controller/auth/Group.php @@ -254,7 +254,7 @@ class Group extends Backend if (($pid || $parentGroupModel) && (!$id || $currentGroupModel)) { $id = $id ? $id : NULL; - $ruleList = collection(model('AuthRule')->order('weigh', 'desc')->select())->toArray(); + $ruleList = collection(model('AuthRule')->order('weigh', 'desc')->order('id', 'asc')->select())->toArray(); //读取父类角色所有节点列表 $parentRuleList = []; if (in_array('*', explode(',', $parentGroupModel->rules))) diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index 897f66ba..b221a90c 100644 --- a/application/admin/controller/auth/Rule.php +++ b/application/admin/controller/auth/Rule.php @@ -27,7 +27,7 @@ class Rule extends Backend parent::_initialize(); $this->model = model('AuthRule'); // 必须将结果集转换为数组 - $ruleList = collection($this->model->order('weigh', 'desc')->select())->toArray(); + $ruleList = collection($this->model->order('weigh', 'desc')->order('id', 'asc')->select())->toArray(); foreach ($ruleList as $k => &$v) { $v['title'] = __($v['title']); @@ -43,6 +43,7 @@ class Rule extends Backend continue; $ruledata[$v['id']] = $v['title']; } + unset($v); $this->view->assign('ruledata', $ruledata); }