// 指定分类标签调用
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;
}
标签:xml,arr,join,scodes,tag,scode,ay,array,sitemap From: https://www.cnblogs.com/hwrex/p/18410113