Tp5 join查询报错

浏览:3781 发布日期:2017/02/25 分类:ThinkPHP5专区 关键字: tp5查询 join
$join[]=array('tb_b a','t.id=a.id','left');
$where['t.id']=array('eq','1');
$res = Db::table('tb_a t')->field('t.id,a.id')->join($join)->where($where)->select();[code]
[/code]正常运行,可以查询到数据,left join也正常。
但是,当$where['a.id']=array('eq','1')时,
报错:Column not found: 1054 Unknown column 'a.id' in 'where clause'。
我在tp5之前的版本里,是都可以正常运行的。
求解
最佳答案
评论( 相关
后面还有条评论,点击查看>>