From 02029bf972d91e856745afd9c9fe3ab57bde40b4 Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Sat, 16 Feb 2019 14:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=84=E5=88=99ruleList?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/auth/Rule.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }