关于switchModel的用法

浏览:1312 发布日期:2015/05/23 分类:求助交流
class ArticleModel extends Model {
    private $switchViewFields = array(
        'Article'=>array('id', 'cate_id', 'name', 'add_time', 'row_sort', 'sub_content', 'sub_desc', 'hits', 'status', 'os', 'money', 'size', 'version', 'like_count', 'comment_count'),
        'ArticleContent'=>array('title', 'keywords', 'description', 'content', '_on'=>'Article.id=ArticleContent.arc_id'),
    );
    
    public function __construct(){
        parent::__construct();
        $this->switchModel('View', array('viewFields'=>$this->switchViewFields));
    }
    
    
    public function getInfo($where){
         $this->find($where);
             echo time();
             p($this->find($where));
    }
}
代码是上面的。我不能这样切换视图模型吗?这样是没有效果的。 求大神帮助
最佳答案
评论( 相关
后面还有条评论,点击查看>>