欢迎访问深圳市智码联动科技有限公司官方网站!
全国服务热线:
152 1949 0811
-
?php $id = 0;if(!empty($cid)){ $id = $cid;$_cid = $cid;
$_limit = "1";
$_type = "self";
$_cidarr = [];
if($_cid == -1){
$_cidarr[] = input('cid') ? input('cid') : 0;
}else{
if (strpos($_cid, ',')) {
$_cidarr = explode(',', $_cid);
}else{
$_cidarr[] = intval($cid);
}
}
$_category = new app\index\model\CategoryModel();
$_catlist = $_category->getCategory(1);
if (1 == 0) {
$_catlist = $_category->clearLink($_catlist);//去除外部链接的栏目
}
//type为parent
if ($_type == 'parent') {
$_parent = $_category->getParents($_catlist, $_cidarr[0]);
$_catlist = $_category->unlimitedForLayer($_catlist, 'child', $_parent[0]['id']);
}else{
//type为top,忽略cid
if($_cid == 0 || $_type == 'top') {
$_catlist = $_category->unlimitedForLayer($_catlist);
}else {
if ($_type == 'self') {
//同级分类
$_pidarr = [];
foreach ($_cidarr as $_k => $_v) {
$_typeinfo = $_category->getSelf($_catlist, $_v);
if ($_typeinfo) {
$_pidarr[] = $_typeinfo['pid'];
}
}
$_catlist = $_category->unlimitedForLayer($_catlist, 'child', $_pidarr ? $_pidarr : 0);
}else {
//son,子类列表
$_catlist = $_category->unlimitedForLayer($_catlist, 'child', $_cidarr);
}
}
}
$_limit_list = explode(',', $_limit);
foreach($_catlist as $autoindex => $catlist):
if(count($_limit_list) > 1){
if(($autoindex < $_limit_list[0]) || ($autoindex > $_limit_list[1])) continue;
} else{
if($autoindex >= $_limit_list[0]) break;
}
$catlist = update_str_dq($catlist, session('sys_areainfo'));
if($catlist['pid'] != 0){
$id = $catlist['pid'];
}
endforeach;}?>
- 首页
- SEO优化
- 网络推广
- 网站建设
- SEM竞价托管
- 客户案例
- 新闻资讯
- 关于我们
全国统一服务电话
公司地址