From a06ef3c29d14ff5f8c5565832dacfeecfabcf499 Mon Sep 17 00:00:00 2001 From: molong Date: Sun, 8 Jul 2018 21:41:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=A2=91=E9=81=93ID=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AD=90=E9=A2=91=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/com/Sent.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extend/com/Sent.php b/extend/com/Sent.php index 121b385d..d39b3199 100644 --- a/extend/com/Sent.php +++ b/extend/com/Sent.php @@ -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 = '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");'; }