根据频道ID获取子频道

This commit is contained in:
2018-07-08 21:41:26 +08:00
parent b86f4e6ab5
commit a06ef3c29d

View File

@@ -36,9 +36,10 @@ class Sent extends Taglib{
public function tagnav($tag, $content){
$field = empty($tag['field']) ? 'true' : $tag['field'];
$tree = empty($tag['tree'])? true : false;
$field = isset($tag['pid']) ? 0 : $tag['pid'];
$tree = isset($tag['tree']) ? true : false;
$parse = $parse = '<?php ';
$parse .= '$__NAV__ = db(\'Channel\')->field('.$field.')->where("status=1")->order("sort")->select();';
$parse .= '$__NAV__ = db(\'Channel\')->field('.$field.')->where("status=1")->where("pid=1")->order("sort")->select();';
if($tree){
$parse .= '$__NAV__ = list_to_tree($__NAV__, "id", "pid");';
}