thinkphp 3.2 D M 加载模型问题

浏览:2116 发布日期:2015/01/25 分类:求助交流 关键字: D M 模型加载
namespace Admin2014\Model;
use Think\Model;
class RecmdModel extends Model {
    protected $articleMdl; //资讯模型
    protected $videoMdl; // 视频模型
    protected $rsRecmdConfig=array(); //推荐友好提示配置变量
    
    protected $_validate = array(
        array('p_id','require','关联id必须填写!',1),
        array('type','require','表名!',1)
    );
    
    protected $_auto = array(
        array('u_id','_autoUId',1,'callback'),
        array('created','_autoDateTime',1,'callback')
    );
    
    
    
    /**
     * 自动填充当前时间
     * 
     */
    protected function _autoDateTime(){
        return date('Y-m-d H:i:s');
    }
    /**
     * 获得操作者id
     */
    protected function _autoUId(){
        return session('user.id');
    }
    
    function _initialize(){
        $this->videoMdl = D('Video');
        $this->articleMdl = D('Article');
        $this->rsRecmdConfig = C('KH_RECMD_POSTION');
    }
}
这个是我的推荐表的类模型,我在分页的时候发现D 和M 进行初始化,然后分页有很严重的区别。
我在使用M的时候是载入比较快的,D就很慢,一直到的超时,都没有加载成功。
我看一下一下D 和 M之间的区别。D会比M在做更多的操作。
我的问题是为什么会出现如此大的差距
最佳答案
评论( 相关
后面还有条评论,点击查看>>