mirror of https://gitee.com/karson/fastadmin.git
优化规则ruleList排序
parent
ac312ef41e
commit
02029bf972
|
|
@ -27,7 +27,7 @@ class Rule extends Backend
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = model('AuthRule');
|
$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)
|
foreach ($ruleList as $k => &$v)
|
||||||
{
|
{
|
||||||
$v['title'] = __($v['title']);
|
$v['title'] = __($v['title']);
|
||||||
|
|
@ -43,6 +43,7 @@ class Rule extends Backend
|
||||||
continue;
|
continue;
|
||||||
$ruledata[$v['id']] = $v['title'];
|
$ruledata[$v['id']] = $v['title'];
|
||||||
}
|
}
|
||||||
|
unset($v);
|
||||||
$this->view->assign('ruledata', $ruledata);
|
$this->view->assign('ruledata', $ruledata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue