public function set_category_cache($categorys) {
$cache_array = array();
foreach ($categorys as $category) {
if($category['modelid'] != 1)
continue;
$parentid = $category['parentid'];
$categoryid = $category['catid'];
$need_cache = false;
if ($parentid == 0) {
$need_cache = true;
} else if(is_array($pp = $categorys[$parentid])) {
if ($pp['parentid'] == 0) {
$need_cache = true;
}
}
if($need_cache)
$cache_array[$parentid][$categoryid] = $categorys[$categoryid];
}
foreach($cache_array as $key => $values) {
setcache('category_content_'. $key ."_". $this->siteid, $values, 'commons');
}
}
PHPCMS緩存分類
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.