thinkphp5.0 使用paginate 分页后 foreach 循环体内不能处理数据的解决办法

方法一、使用toArray()将查询出来的分页数据转成数组
$data = $goods_list->toArray();
$list = $data[‘data’];//要处理的数据

在这里插入图片描述
方法二、 $data = $goods_list->all();
在这里插入图片描述

来源:https://blog.csdn.net/github_38985401/article/details/83347416

猜你喜欢

转载自blog.csdn.net/gb4215287/article/details/89846241