{eyou:if condition='($route_param.tid == 38 && $areaid === 0)'} <!--调用全部职称产品并分页--> {eyou:php} //计算limit属性 $pagesize = 12; if(!empty($route_param['pa'])){ $curpage = $route_param['pa']; $start_li = $pagesize*($curpage-1); //开始位置 $end_li = $pagesize*$curpage; $limit_cat_value = $start_li.','.$pagesize; }else{ $curpage = 1; $limit_cat_value = '0,'.$pagesize; } {/eyou:php} {eyou:assign name='limit_cat' value="$limit_cat_value" /} <!--直接用sql--> <?php //area_id=$areaid $where = "parent_id=38 and topid=38 and is_del=0 and status=1"; ?> {eyou:sql sql="SELECT id FROM __PREFIX__arctype WHERE $where order by update_time desc limit $limit_cat" cachetime='3600' id='res'} {eyou:foreach name='$res' item='cat'} {eyou:type typeid='$cat' empty='暂时没有数据' id='item'} <li style="position:relative;"> <a href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'],$item['area_id'])}"><img src="https://oss.zc10000.com/static/images/bg_1.png" width='160' height='140' alt="{$item.typename}" title="{$item.typename}"/></a> <a href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'],$item['area_id'])}" style="position: absolute;bottom:0;" class="aom">{$item.typename}</a> <span style="display:block;position: absolute;top:35%;width:100%;text-align:center;font-size: 20px;font-weight: bold;"> <a href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'],$item['area_id'])}">{$item.typename}</a> </span> </li> {/eyou:type} {/eyou:foreach} {/eyou:sql} {eyou:else /} <!--具体职称分类--> {eyou:php} //计算limit属性 $pagesize = 12; if(!empty($route_param['pa'])){ $curpage = $route_param['pa']; $start_li = $pagesize*($curpage-1); //开始位置 $end_li = $pagesize*$curpage; $limit_cat_value = $start_li.','.$pagesize; }else{ $curpage = 1; $limit_cat_value = '0,'.$pagesize; } {/eyou:php} {eyou:assign name='limit_cat' value="$limit_cat_value" /} <!--一开始用sql 用limit浪费时间--> <!--直接用sql--> <?php //area_id=$areaid $where1 = "area_id=$areaid and parent_id=38 and topid=38 and is_del=0 and status=1"; ?> {eyou:sql sql="SELECT id FROM __PREFIX__arctype where $where1 order by add_time asc limit $limit_cat" cachetime='3600' id='res'} {eyou:foreach name='$res' item='cat'} {eyou:type typeid='$cat' empty='暂时没有数据' id='item'} <li style="position:relative;"> <a href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'],$item['area_id'])}"><img src="https://oss.zc10000.com/static/images/bg_1.png" width='160' height='140' alt="{$item.typename}" title="{$item.typename}"/></a> <a href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'],$item['area_id'])}" style="position: absolute;bottom:0;" class="aom">{$item.typename}</a> <span style="display:block;position: absolute;top:35%;width:100%;text-align:center;font-size: 20px;font-weight: bold;"> <a href="{:get_tid_url_2($item['typeurl'],0,0,0,'产品',$item['topid'],$item['area_id'])}">{$item.typename}</a> </span> </li> {/eyou:type} {/eyou:foreach} {/eyou:sql} {/eyou:if}