diff --git a/app/Listeners/SendCoupons.php b/app/Listeners/SendCoupons.php index efcf22bf..cbedd670 100644 --- a/app/Listeners/SendCoupons.php +++ b/app/Listeners/SendCoupons.php @@ -42,6 +42,9 @@ class SendCoupons $products = $order->products()->where('is_gift', false)->get()->toArray(); $_products = array_column($products, 'total_amount', 'sku_id'); $partSkus = ProductPartSku::with('part')->whereIn('sku_id', array_keys($_products))->get(); + + $inValidParts = []; + foreach ($partSkus as $partSku) { if ($partSku->part?->is_show) { $inValidParts[$partSku->part_id][$partSku->sku_id] = $_products[$partSku->sku_id] ?? 0; @@ -52,6 +55,7 @@ class SendCoupons // } } } + // dd($inValidParts); //根据分区获取活动 $partActivities = ActivityProductPart::with(['activity', 'activity.coupons'])->whereHas('activity', function (Builder $query) {