<?php
$catid = $route_param['catids'];
//var_dump($catid);

//include 时 $catid = 8值来自第一次获取参数 转换之前
//转换之后的$catid 并不会传递 这个是php机制问题  暂时不管
?>
<link rel="stylesheet" href="/template/pc/components/text/style_5.css"   media="all">
<div class="sx-content-1">
    <div class="sx-box-1">
        <div class="layui-row">
            <div class="layui-col-xs6">
                <span>

<?php
    /* */
    if((int)$parentid === 38){
          //大类
        $sql = "SELECT * FROM ey_arctype WHERE id = (SELECT id FROM ey_arctype WHERE id<$catid  and grade=1 and topid=38 and parent_id=38 and is_del=0 ORDER BY add_time DESC LIMIT 1)";
    }else{
        $sql = "SELECT * FROM ey_arctype_cat WHERE id = (SELECT id FROM ey_arctype_cat WHERE id<$catid and parent_id=$parentid and is_del=0 ORDER BY add_time DESC LIMIT 1)";
    }
?>


{eyou:if condition='((int)$parentid === 38)'}
    {eyou:sql sql="$sql" cachetime='3600' empty='没有数据' id='kp'}
    {eyou:type typeid='$kp.id' empty='暂时没有数据'}
    <a href="{:get_tid_url_2($field['typeurl'],0,0,0,$field['type'],$field['topid'],$field['area_id'])}" title="{$field.typename}"> {$field.typename} </a>
    {/eyou:type}
    {/eyou:sql}
{eyou:else /}
{eyou:sql sql="$sql" cachetime='3600' empty='没有数据' id='kp'}
    <?php
    $sql2 = "select number from ey_seo_number where type=1 and parentid=".$parentid." and topid=38 and area_id=0 and aid=".$kp['id'];
    ?>
    {eyou:sql sql="$sql2" cachetime='3600' id='field99'}
        <a href="/id{$cid}/sid{$field99.number}" title="{$kp.typename}"> {$kp.typename} </a>
    {/eyou:sql}
{/eyou:sql}
{/eyou:if}



                </span>&nbsp;
                <a href="" class="upo">上一篇</a>
            </div>
            <div class="layui-col-xs6">
                <a href="" class="upo">下一篇</a>&nbsp;
                <span>
<?php
if((int)$parentid === 38){
    //大类
    $sql = "SELECT * FROM ey_arctype WHERE id = (SELECT id FROM ey_arctype WHERE id>$catid and grade=1 and topid=38 and parent_id=38 and is_del=0 ORDER BY add_time asc LIMIT 1)";
}else{
    $sql = "SELECT * FROM ey_arctype_cat WHERE id = (SELECT id FROM ey_arctype_cat WHERE id>$catid and parent_id=$parentid and is_del=0 ORDER BY add_time asc LIMIT 1)";
}

?>

{eyou:if condition='((int)$parentid === 38)'}
    {eyou:sql sql="$sql" cachetime='3600' empty='没有数据' id='kp'}
    {eyou:type typeid='$kp.id' empty='暂时没有数据'}
    <a href="{:get_tid_url_2($field['typeurl'],0,0,0,$field['type'],$field['topid'],$field['area_id'])}" title="{$field.typename}"> {$field.typename} </a>
    {/eyou:type}
    {/eyou:sql}
{eyou:else /}
{eyou:sql sql="$sql" cachetime='3600' empty='没有数据' id='kp'}
    <?php
    $sql2 = "select number from ey_seo_number where type=1 and parentid=".$parentid." and topid=38 and area_id=0 and aid=".$kp['id'];
    ?>
    {eyou:sql sql="$sql2" cachetime='3600' id='field99'}
        <a href="/id{$cid}/sid{$field99.number}" title="{$kp.typename}"> {$kp.typename} </a>
    {/eyou:sql}
{/eyou:sql}
{/eyou:if}


                </span>
            </div>
        </div>
    </div>
</div>