1.根据catid 获取 栏目名称

$CATEGORYS = getcache('category_content_'.$siteid,'commons');
$name = {$CATEGORYS[$catid]['catname']}

 

2.根据catid 取子栏目的catid和名称

/*
     * 根据catid 取子栏目
     */
    private function get_child_catid($parents_catid){
        $categorys = getcache('category_content_1','commons');
        $arrchildid = $categorys[$parents_catid][arrchildid];
        $arrchildid = explode(',',$arrchildid);
        $result = array();
        foreach($arrchildid as $k=>$v){
            $name = $categorys[$v]['catname'];
            $result[$k]['catid']=$v;
            $result[$k]['catname']=$name;
        }
        $result = array_slice($result,1);
        return $result;
    }

 

相关文章:

  • 2021-09-27
  • 2021-12-24
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2021-09-24
  • 2021-07-04
  • 2021-12-03
  • 2021-11-01
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案