chunk分块的使用
使用with查询数据
//贪婪模式闭包过滤
$orders = MemberLevelOrder::with(['hasOneOrderGoods'=>function($query){
return $query->where('goods_id',config('custom.goods_id'));
}])->where($condition)->limit(2000)->chunk(500, function ($coll) {
self::setGrowing($coll);
});