调整下单listener通过活动发送优惠券
parent
9020b9501a
commit
b67c53c2c2
|
|
@ -55,8 +55,8 @@ class SendCoupons
|
|||
// }
|
||||
}
|
||||
}
|
||||
|
||||
// dd($inValidParts);
|
||||
//存在有效分区时
|
||||
if ($inValidParts) {
|
||||
//根据分区获取活动
|
||||
$partActivities = ActivityProductPart::with(['activity', 'activity.coupons'])->whereHas('activity', function (Builder $query) {
|
||||
return $query->where('is_use', true)->where('started_at', '<', now())->where('ended_at', '>=', now());
|
||||
|
|
@ -100,6 +100,7 @@ class SendCoupons
|
|||
'activity_id'=>$partActivity->activity_id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
} catch (Throwable $th) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue