<!--拼接查询条件-->
<?php

    //关联 其他栏目 用的 查询
    $catid = 0;

    if(empty($provid)){
        $provid = 0;
    }
    if(empty($cityid)){
        $cityid = 0;
    }

    //只调用省级 城市为空
    if((int)$provid === 0 && (int)$catid === 0){
        //所有省份的数据
        //and province_id='0' and city_id='0'
        $where = "typeid=".$tid." and is_del=0";
    }else if((int)$provid > 0 && (int)$catid === 0 && (int)$cityid === 0){
//只选择省 不选择职称
//and city_id='0'
$where = "typeid=".$tid." and province_id='$provid' and is_del=0";
}else{
//存在城市
// and stypeid='$catid'
$where = "typeid=".$tid." and province_id='$provid' and city_id='$cityid' and is_del=0";
}

if($tagid > 0){
//加入筛选
$where = $where.' and product_tag_id='.$tagid;
}

//var_dump($where);

?>
<?php
    //var_dump($route_param['page']);
    //计算limit属性
    $pagesize = 12;
    if(!empty($route_param['page'])){
        $curpage = $route_param['page'];
        $start_li = $pagesize*($curpage-1); //开始位置
        $end_li = $pagesize*$curpage;
        $limit_cat_value = $start_li.','.$pagesize;
    }else{
        $curpage = 1;
        $limit_cat_value = '0,'.$pagesize;
    }
?>

{eyou:assign name='limit_cat' value="$limit_cat_value" /}
<?php
    //$sql = "select GROUP_CONCAT(aid SEPARATOR ',') AS ids from ey_archives where $where order by update_time desc limit $limit_cat";
    $sql = "select aid from ey_archives where $where order by update_time desc limit $limit_cat";
    //echo $sql;die;
    $ids = '';
?>
{eyou:sql sql="$sql" cachetime='3600' empty='没有数据' id="res"}
<?php
    //var_dump($provid);
    //var_dump($res);
    $ids = $res['aid'].','.$ids;
?>
{/eyou:sql}
<?php
    $ids = preg_replace("/.$/", "", $ids);
    //var_dump($ids);
?>
<!--开始查询-->
{eyou:empty name='$ids' /}
----------------------(暂无相关文档)-----------------------
{eyou:else /}
{eyou:artlist idlist="$ids" titlelen='30' limit='0,12' infolen='160' orderby='update_time desc' addfields='handle_time,province_id'}
<?php
//var_dump($field['aid']);
?>
<li class="font-563-active-{$i}">
    <img src="https://www.wetools.com/imgplaceholder/14x12"/>
    <a
            href="{:get_tid_url_2($field['arcurl'],$field['typeid'],$field['stypeid'],'0','',0,$field['province_id'],$field['city_id'])}">{$field.title}</a>
    <span>{$field.add_time|MyDate='Y-m-d H:i',###}</span>
    {eyou:empty name='$field.seo_description' /}
    <p style="height:1px;"></p>
    {eyou:else /}
    <p>{$field.seo_description|msubstr=###,0,35,true}</p>
    {/eyou:empty}
</li>

{/eyou:artlist}
{/eyou:empty}