diff --git a/app/Services/GoodSku/GoodSkuService.php b/app/Services/GoodSku/GoodSkuService.php index 16d26bf..a37dd1a 100644 --- a/app/Services/GoodSku/GoodSkuService.php +++ b/app/Services/GoodSku/GoodSkuService.php @@ -106,11 +106,11 @@ class GoodSkuService $externalSkuIds = collect($skusWithCombinationGoods)->pluck("external_sku_id")->toArray(); $skuIds = collect($skusWithCombinationGoods)->pluck("id")->toArray(); //关联的组合数据 - $combinationGoods = CombinationGood::query()->with("goodsSku:id,external_sku_id")->where('item_id', $skuIds)->get()->toArray(); + $combinationGoods = CombinationGood::query()->with("goodsSku:id,external_sku_id")->whereIn('item_id', $skuIds)->get()->toArray(); $externalSkuIds = collect($combinationGoods)->pluck("goods_sku.external_sku_id")->merge(collect($externalSkuIds))->toArray(); - + Log::info("需要查询的externalSkuIds",[$externalSkuIds]); //默认只查15天内未发货的数据 - $startTime = Carbon::now()->subDays(15)->startOfDay()->toDateTimeString(); + $startTime = Carbon::now()->subDays(15)->toDateTimeString(); $unshippedDataCollect = BusinessOrderItem::query() ->with([ 'shop:id,name', @@ -124,7 +124,7 @@ class GoodSkuService ->where("business_order_items.created_at", ">=", $startTime)->where("b.cancel_status", "=", 0) ->groupBy('external_sku_id')->get()->toArray(); - Log::info("盘点未发货数据".implode(",",$externalSkuIds),[$unshippedDataCollect]); + Log::info("盘点未发货数据",[$unshippedDataCollect]); //重组订单 foreach ($unshippedDataCollect as $businessOrderItem) {