批量处理函数的bug

浏览:391 发布日期:2019/05/22 分类:ThinkPHP5专区
User::with(['profile' => function($query){
$query->withField('Name');
}])->chunk(100,function($userList) use ($output) {...},"Id")
如果user表中主键与表profile中主键都叫Id的话
批量查询就会报错
Column 'Id' in where clause is ambiguous
最佳答案
评论() 相关
后面还有条评论,点击查看>>