求助hasWhere方法 添加关联模型条件查出的结果不出现子数据

浏览:581 发布日期:2018/01/11 分类:求助交流 关键字: hasWhere
求助
场景
一对多关联
Knowledge表的 ID
关联
Question表的chapterid


Knowledge模型public function profile()
    {
        return $this->hasMany('Question','chapterid','id');
    }
调用$Knowledge_obj->with('profile')->where($where)->order('id asc')->page($page,$limit)->select();不添加关联模型条件完全OK$Knowledge_obj->hasWhere('profile',['status'=>1])->where($where)->order('id asc')->page($page,$limit)->select();添加关联模型条件查出的结果不出现子数据profile



请问下各路大神 是不是哪里打开方式有误
最佳答案
评论( 相关
后面还有条评论,点击查看>>