修复送券BUG
parent
aef929bfba
commit
9020b9501a
|
|
@ -42,6 +42,9 @@ class SendCoupons
|
||||||
$products = $order->products()->where('is_gift', false)->get()->toArray();
|
$products = $order->products()->where('is_gift', false)->get()->toArray();
|
||||||
$_products = array_column($products, 'total_amount', 'sku_id');
|
$_products = array_column($products, 'total_amount', 'sku_id');
|
||||||
$partSkus = ProductPartSku::with('part')->whereIn('sku_id', array_keys($_products))->get();
|
$partSkus = ProductPartSku::with('part')->whereIn('sku_id', array_keys($_products))->get();
|
||||||
|
|
||||||
|
$inValidParts = [];
|
||||||
|
|
||||||
foreach ($partSkus as $partSku) {
|
foreach ($partSkus as $partSku) {
|
||||||
if ($partSku->part?->is_show) {
|
if ($partSku->part?->is_show) {
|
||||||
$inValidParts[$partSku->part_id][$partSku->sku_id] = $_products[$partSku->sku_id] ?? 0;
|
$inValidParts[$partSku->part_id][$partSku->sku_id] = $_products[$partSku->sku_id] ?? 0;
|
||||||
|
|
@ -52,6 +55,7 @@ class SendCoupons
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dd($inValidParts);
|
// dd($inValidParts);
|
||||||
//根据分区获取活动
|
//根据分区获取活动
|
||||||
$partActivities = ActivityProductPart::with(['activity', 'activity.coupons'])->whereHas('activity', function (Builder $query) {
|
$partActivities = ActivityProductPart::with(['activity', 'activity.coupons'])->whereHas('activity', function (Builder $query) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue