导航功能增加分类

This commit is contained in:
2016-12-12 19:04:14 +08:00
parent 4412f70b9b
commit 1cf7ebb77e
4 changed files with 89 additions and 57 deletions

View File

@@ -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();
}