工作中遇到的一個問題,如何獲得欄目下的模型,現在代碼分享出來,供大家學習
獲得模型數據庫
$siteids = getcache('category_content', 'commons');
$MODEL = getcache('model', 'commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_'.$siteid, 'commons');
$category = $CATEGORYS[$catid];
$modelid = $category['modelid'];
$this->content_db->set_model($modelid);
$tablename = $this->content_db->db_tablepre.$MODEL[$modelid]['tablename'];
|
新聞熱點
疑難解答