复制代码 代码如下:
//@获取子栏目ID号
private function sonCategoryIds($categoryID)
{
//@初始化栏目数组
$array[] = $categoryID;
do
{
$ids = '';
$temp = $this->mysql->select('SELECT `id` FROM `pcb_article_category` WHERE `parentID` IN (' . $categoryID . ')');
foreach ($temp as $v)
{
$array[] = $v['id'];
$ids .= ',' . $v['id'];
}
$ids = substr($ids, 1, strlen($ids));
$categoryID = $ids;
}
while (!empty($temp));
$ids = implode(',', $array);
return $ids;
}
//@获取子栏目ID号
private function sonCategoryIds($categoryID)
{
//@初始化栏目数组
$array[] = $categoryID;
do
{
$ids = '';
$temp = $this->mysql->select('SELECT `id` FROM `pcb_article_category` WHERE `parentID` IN (' . $categoryID . ')');
foreach ($temp as $v)
{
$array[] = $v['id'];
$ids .= ',' . $v['id'];
}
$ids = substr($ids, 1, strlen($ids));
$categoryID = $ids;
}
while (!empty($temp));
$ids = implode(',', $array);
return $ids;
}
标签:
获取栏目,子级,孙级栏目
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“PHP获取栏目的所有子级和孙级栏目的ID号示例”评论...