route(); $route_domain = request()->domain(); $route_url = request()->url(); //判断区域 $domain = explode('//',$route_domain); //str_replace('https://', '', $route_domain); $domain = explode('.',$domain[1]); $site = $domain[0]; //城市主页需要执行 if(!empty($site) && $site != 'zc' && $site != 'www'){ //判定为二级域名 $area_name = ''; $sql2 = "SELECT id,name FROM ey_citysite WHERE domain = '".$site."'"; }else{ $site = 'www'; } //伪山东 $page === "provincial" //var_dump($route_param);die; $site_1 = $route_param['site']?$route_param['site']:''; if($site_1 == 'shandong' && $site == 'www'){ $site = 'shandong'; } //处理城市参数 if(!empty($route_param['site'])){ $city_domain = $route_param['site']; $sql3 = "SELECT id,name FROM ey_citysite WHERE domain = '".$city_domain."'"; }else{ $city_domain = 'none'; } $is_area_data = 0; $where = ''; ?> {eyou:if condition='($sql2 !== "")'} {eyou:sql sql='$sql2' cachetime='3600' id='area'} {eyou:php} $area_name = ''.$area['name'].''; $area_id = ''.$area['id'].''; $area_where = "province_id=".$area_id." "; {/eyou:php} {/eyou:sql} {/eyou:if} {eyou:if condition='($site == "www")'} {eyou:assign name='provid' value="0" /} {eyou:assign name='provid_name' value="山东" /} {eyou:else /} {eyou:assign name='provid' value="$area_id" /} {eyou:assign name='provid_name' value="$area_name" /} {/eyou:if} {eyou:if condition='($sql3 !== "")'} {eyou:sql sql='$sql3' cachetime='3600' id='area'} {eyou:php} $city_name = ''.$area['name'].''; $city_id = ''.$area['id'].''; $area_where = "province_id=".$area_id." and city_id=".$city_id." "; {/eyou:php} {/eyou:sql} {/eyou:if} {eyou:assign name='cityid' value="$city_id" /} {eyou:assign name='cityid_name' value="$city_name" /} {eyou:if condition='($sql2 !== "")'} {eyou:php} //针对常见问题 $sql4 = "SELECT count(*) as num FROM ey_archives WHERE ".$area_where." and typeid=111 and is_del=0 and status=1 and arcrank=0 "; {/eyou:php} {eyou:sql sql='$sql4' cachetime='3600' id='area_data'} {eyou:php} if((int)$area_data['num'] > 0){ //存在区域数据 $is_area_data = 1; } {/eyou:php} {/eyou:sql} {/eyou:if}