subDays(15)->getPreciseTimestamp(3); $shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get(); BusinessOrder::query()->where('confirm_at', '>=', $startTime) ->where('shipping_status',BusinessOrderShippingStatus::UNSHIP) ->where('cancel_status',0) ->chunk(200, function ($orders) use ($shops) { foreach ($orders as $order) { $shop = $shops->where('id',$order['shop_id'])->first(); if(!empty($shop)){ BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->queryStatusAndSync($order); usleep(10); } } }); } }