A5下载文章资讯

分类分类

phpcms v9如何获得数据库模型

2015-05-27 10:05作者:sa

工作中遇到的一个问题,如何获得栏目下的模型,现在代码分享出来,供大家学习

获得模型数据库

$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'];

 

展开全部

相关

说两句网友评论
    我要跟贴
    取消