laravel 使用with查询数据和 chunk分块的使用

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);
        });
原文地址:https://www.cnblogs.com/photo520/p/11804132.html