Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

修复Model自动校验主键唯一Insert Bug #518

Open
wants to merge 1 commit into
base: 3.2
Choose a base branch
from

Conversation

UniqueOnly
Copy link

当开发者将主键pk也写入validate时,程序会生成如下语句select * from table where id <> '{$id}' limit 1,即使设置了主键,这插入create校验时就已被拒绝,正确应为select * from table where id = '{$id}' limit 1,故修复BUG,加入判断当前pk是否等于当前传入key,是则不进行完善编辑的时候验证唯一。

当开发者将主键pk也写入validate时,程序会生成如下语句select * from table where id <> '{$id}' limit 1,即使设置了主键,这插入create校验时就已被拒绝,正确应为select * from table where id = '{$id}' limit 1,故修复BUG,加入判断当前pk是否等于当前传入key,是则不进行完善编辑的时候验证唯一。
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant