think-orm icon indicating copy to clipboard operation
think-orm copied to clipboard

think-orm v2.0.33 多对多关联 报错pivot不是唯一

Open diankemao opened this issue 4 years ago • 2 comments

多对多关联 报错 pivot不是唯一:

出错版本 topthink/think-orm": "2.0.33" 出现以下问题,但是2.0.33之前的版本没有问题。

错误:SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'pivot'

@liu21st @yunwuxin @vus520 @Lofanmi 请大佬们帮忙检查以下原因?升级2.0.33后报错了

执行查询 image

模型定义 image

环境: "php": "7.4.8",
"topthink/framework": "6.0.3" "topthink/think-orm": "2.0.33" mysql=8.0.x

diankemao avatar Aug 21 '20 03:08 diankemao

think-orm v2.0.33: image

回退 think-orm v2.0.32版本就没有问题

diankemao avatar Aug 21 '20 03:08 diankemao

可以更新到最新开发版再试试

big-dream avatar Sep 03 '20 09:09 big-dream