-
工商注冊財務代理記賬類...
-
貨運物流快遞類網(wǎng)站pb...
-
空氣凈化器環(huán)保節(jié)能設備...
-
建材裝飾公司類網(wǎng)站pb...
-
茶葉新聞資訊類網(wǎng)站pb...
-
玻璃棉板環(huán)保類網(wǎng)站pb...
-
五金軸承推廣落地頁pb...
-
家庭裝修設計類網(wǎng)站pb...
-
石材石業(yè)類網(wǎng)站pbootcms模...
-
蛋糕面包食品類網(wǎng)站pb...
-
導航網(wǎng)站pbootcms模板(自適...
-
電商平臺資訊新聞類網(wǎng)站...
-
建筑工程膜結(jié)構(gòu)類網(wǎng)站...
-
環(huán)保設備研發(fā)制造類網(wǎng)站...
-
水果食品類網(wǎng)站pbootcms模...
-
鋁合金門窗類網(wǎng)站pboot...
-
園林苗木綠化工程類網(wǎng)站...
-
電動平車類網(wǎng)站pbootcms模...
-
木制托盤類網(wǎng)站pbootcms模...
-
電腦系統(tǒng)軟件下載類網(wǎng)站...
2、打開/apps/home/controller/SitemapController.php文件,在73行后面增加// 指定分類標簽調(diào)用
public function getSortTags($scode)
{
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_model c',
'b.mcode=c.mcode',
'LEFT'
)
);
$scode_arr = array();
if ($scode) {
// 獲取所有子類分類編碼
$this->scodes = array(); // 先清空
$scodes = $this->getSubScodes(trim($scode)); // 獲取子類
// 拼接條件
$scode_arr = array(
"a.scode in (" . implode_quot(',', $scodes) . ")",
"a.subscode='$scode'"
);
}
$result = parent::table('ay_content a')->where('a.status=1')->where("c.type=2 AND a.tags<>''")
->where($scode_arr, 'OR')
->join($join)
->order('a.visits DESC')
->column('a.tags');
return $result;
}
然后再次訪問sitemap.xml就可以看到里面生成的附帶了tag的鏈接地址。if (! ! $rs = $this->model->getSortTags('')) {
$tags = implode(',', $rs); // 把欄目tags串起來 AB模板網(wǎng)
$tags = array_unique(explode(',', $tags)); // 再把所有tags組成數(shù)組并去重
foreach ($tags as $key2 => $value2) {
if (! in_array($value2, array_column($data, 'tags'))) { // 避免重復輸出
$url_rule_type = $this->config('url_rule_type') ?: 3;
if ($url_rule_type == 3) {
$link2 = Url::home('tag=' . urlencode($value2), '');
} else {
$link2 = Url::home('tag/' . urlencode($value2));
}
$str .= $this->makeNode($link2, date('Y-m-d'), '0.80');
}
}
}