如何使用块方法在laravel中获取10000条记录?
答
首先检索所有记录,然后块1000条记录一次。将代码分成不同的功能,以便排序。即使是大块也是这样做的,它将收集分解成多个集合。 ex。 User :: chunk(1000,function($ rows){}
这回答在这里:https://stackoverflow.com/questions/45323659/laravel-collection-with-relations-take-a-lot-of-时间/ 45324021#45324021 – aaron0207
[Laravel - 具有关系的集合需要大量时间的可能的副本](https://stackoverflow.com/questions/45323659/laravel-collection-with-relations-take-a-lot-of-时间) –