Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不指定字段的时候会报错 #4

Open
jonny77 opened this issue Aug 27, 2020 · 1 comment
Open

不指定字段的时候会报错 #4

jonny77 opened this issue Aug 27, 2020 · 1 comment

Comments

@jonny77
Copy link

jonny77 commented Aug 27, 2020

'username|用户名' => [
'rule'=>'required|alpha_num|unique:hyperf_admin.member',
'props' => [
'size' => 'small',
'maxlength' => 20,
],
],

Unknown column '35_to_ignore' in 'where clause' 35 是 正在编辑的id

@daodao97
Copy link
Member

这里的原因是控制器底层在 unique 这种 约束条件下自动拼接了 {pk}_to_ignore, 具体代码在 code, 如果不带字段的话, 就会拼接成 unique:hyperf_admin.member,{pk}_to_ingore 从而导致错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants