作者 pppscn
提交者 Karson

优化规则ruleList排序

@@ -27,7 +27,7 @@ class Rule extends Backend @@ -27,7 +27,7 @@ class Rule extends Backend
27 parent::_initialize(); 27 parent::_initialize();
28 $this->model = model('AuthRule'); 28 $this->model = model('AuthRule');
29 // 必须将结果集转换为数组 29 // 必须将结果集转换为数组
30 - $ruleList = collection($this->model->order('weigh', 'desc')->select())->toArray(); 30 + $ruleList = collection($this->model->order('weigh', 'desc')->order('id', 'asc')->select())->toArray();
31 foreach ($ruleList as $k => &$v) 31 foreach ($ruleList as $k => &$v)
32 { 32 {
33 $v['title'] = __($v['title']); 33 $v['title'] = __($v['title']);
@@ -43,6 +43,7 @@ class Rule extends Backend @@ -43,6 +43,7 @@ class Rule extends Backend
43 continue; 43 continue;
44 $ruledata[$v['id']] = $v['title']; 44 $ruledata[$v['id']] = $v['title'];
45 } 45 }
  46 + unset($v);
46 $this->view->assign('ruledata', $ruledata); 47 $this->view->assign('ruledata', $ruledata);
47 } 48 }
48 49