调整下单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) {
|
$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());
|
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,
|
'activity_id'=>$partActivity->activity_id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
} catch (Throwable $th) {
|
} catch (Throwable $th) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue