tp5怎么关联模型进行条件查询?

浏览:15264 发布日期:2017/05/10 分类:ThinkPHP5专区 关键字: 关联模型
比如我User模型关联UserInfo模型,我怎么根据UserInfo字段查询出结果来?
比如User有id,username等字段,userinfo有integral等字段,我是想根据integral字段作为条件查询。
我写法:model('UserDiscount')->with('user')->where(array('integral'=>10))->paginate(10);
但是这样会报字段出错~
最佳答案
评论() 相关
后面还有条评论,点击查看>>