hyperf-admin-demo icon indicating copy to clipboard operation
hyperf-admin-demo copied to clipboard

不指定字段的时候会报错

Open jonny77 opened this issue 5 years ago • 1 comments

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

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

jonny77 avatar Aug 27 '20 07:08 jonny77

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

daodao97 avatar Mar 23 '21 11:03 daodao97