TAG标签:
(!config('sys.sys_area')):
echo(tags(5));
else:
$_limit = "10";
$_top = intval('0');
$_con = intval('0');
$_url = intval('0');
$_topzm = -1;
$_pid = 0;
$_conurl = intval('');
$_type = 'current';
$_where = [];
if ($_top) {
$_where['istop'] = $_top;
}
if ($_con) {
$_where['iscon'] = $_con;
}
if ($_url) {
$_where['isurl'] = $_url;
}
if ($_topzm != -1) {
$_where['etitle'] = ['LIKE', $_topzm.'%'];
}
$_area = session('sys_areainfo');
if ($_type == "current") {
$_where['id']= $_area ? $_area['id'] : '';
}
if ($_type == "province") {
$_where['id']= $_area ? getprovince($_area['id']) : '';
}
if ($_type == -1 || $_type == "group" || $_type == "1" ) {
if ($_pid) {
$_where['pid'] = $_pid;
}else{
if ($_area && !$_conurl) {
$_where['pid'] = $_area['id'];
}else{
$_where['pid'] = 0;
}
}
}
$_where['isopen'] = 1;
$_limit = "10";
$_infolist = db('area')->where($_where)->orderRaw("sort asc")->limit($_limit)->select();
if (empty($_infolist)) {
if ($_area && !$_conurl) {
$_where['pid'] = $_area['pid'];
$_infolist = db('area')->where($_where)->orderRaw("sort asc")->limit($_limit)->select();
}
}
$_areamodel = new app\index\model\AreaModel();
$_category = new app\index\model\CategoryModel();
$_content = new app\index\model\ContentModel();
foreach($_infolist as $autoindex => $area):
$area = $_areamodel->getOneArea(['id'=>$area['id']]);
$area['ys_url'] = $_areamodel->getAreaUrl($area);
$area['ys_title'] = $area['title'];
$area['ys_stitle'] = $area['stitle'];
if ($_conurl) {
$area['url'] = $_areamodel->getAreaUrl($area);
}else{
if (isset($content)) {
$_data = $_content->getContentArea($content, $area);
$area['url'] = $_data['url'];
$area['title'] = $area['stitle'].$content['ys_title'];
}else{
if (isset($category)){
$_data = $_category->getCategoryArea($category, $area);
$area['url'] = $_data['url'];
$area['title'] = $area['stitle'].$category['ys_title'];
}else{
$area['url'] = $_areamodel->getAreaUrl($area);
}
}
}
echo(tags(5,$area['ys_title'],$area['ys_url']));
endforeach;endif; ?>