导航功能增加分类
This commit is contained in:
@@ -16,11 +16,13 @@ class Channel extends Admin {
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$pid = input('pid', 0);
|
||||
public function index($type = 0) {
|
||||
/* 获取频道列表 */
|
||||
//$map = array('status' => array('gt', -1), 'pid'=>$pid);
|
||||
$map = array('status' => array('gt', -1));
|
||||
if ($type) {
|
||||
$map['type'] = $type;
|
||||
}
|
||||
$list = db('Channel')->where($map)->order('sort asc,id asc')->column('*', 'id');
|
||||
|
||||
if (!empty($list)) {
|
||||
@@ -30,8 +32,11 @@ class Channel extends Admin {
|
||||
|
||||
config('_sys_get_channel_tree_', true);
|
||||
|
||||
$this->assign('tree', $list);
|
||||
$this->assign('pid', $pid);
|
||||
$data = array(
|
||||
'tree' => $list,
|
||||
'type' => $type
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('导航管理');
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user