注意:变量 $catid 需要是从控制器里解析出来的
<div class="show-right-top"> <div class="sch-recruit-right-title"> <p><img src="/statics/boot/images/quan3.png">快速链接</p> </div> <div class="sch-recruit-right-con"> <?php $catid_list = []; $parentid = 45; ?> {pc:get sql="SELECT catid,parentid FROM bh_category WHERE parentid IN (SELECT parentid FROM bh_category WHERE catid=$catid)" return="data"} {loop $data $key $val} <?php $catid_list[] = $val['catid']; $parentid = $val['parentid'];?> {/loop} {/pc} <?php if (($CATEGORYS[$top_parentid][catid] == 10) && in_array($catid, $catid_list)) { $catid = $parentid; } else if ($catid == 86) { $catid = 48; } else { $catid = 45; } ?> {pc:content action="category" catid="$catid" num="18" siteid="$siteid" order="listorder ASC"} {loop $data $r} <p><a href="{$r[url]}">{$r[catname]}</a></p> {/loop} {/pc} </div> </div>
其他推荐链接:https://baijiahao.baidu.com/s?id=1617259769784974055&wfr=spider&for=pc
标签:catid,get,标签,pc,phpcms,parentid,loop From: https://www.cnblogs.com/qk1314/p/18158253