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
bug,分页 #500
Comments
Paginator类中,jsonSerialize()方法在tp6上会被执行, 在tp8中被跳过了,问题出在这里,不知道为何跳过了 |
刚无意间调整了 方法参数的位置, 发现在myJson($data, $msg, $code) 只要$data参数放第一位就可以自动toArray, |
看下你myjson代码 |
我刚测试了 $data 在tp8下必须放第一位才会自动toArray,TP6没有这个问题 |
你是说数组里的data放到数组开头,还是参数里的data放到参数开头。 |
错误: 正常: 刚发现,$data还不能固定类型,不然依然不能toarray |
或者是349行的获取到得args。 |
我试了一下,没有复现出你说的情况。要不你更新下php的版本试试,之前的php8之后的版本,调整过反射相关的bug。 |
找到问题所在了,不是参数位置问题, 是类型问题: 之前是 int|string|array, 但是不能这么写,只有单独使用array或者mixed才可以 |
应该也不是这个问题,我用你给的myjson测试,没有问题。可以再找找。mixed本身就能覆盖int、string等,不要紧的。 |
好的,谢谢 |
frameword:8.0.2
orm:3.0.13
使用分页paginate方法,在控制器使用return json() 可以被正常对象输出
如果将 json()封装为 自己的方法return myJson(),则分页会以html输出
在tp6上没有这个问题
The text was updated successfully, but these errors were encountered: