对于优惠卷开始和结束时间的困惑?
优惠卷如果没有 填写 开始时间和结束时间,是否就表示优惠卷 可以随时使用。
如果 不能得话,是不是应该把 判断条件改成 ||
app/Http/Controllers/CouponCodesController.php
if ($record->not_before && $record->not_before->gt(Carbon::now())) {
return response()->json(['msg' => '该优惠券现在还不能使用'], 403);
}
if ($record->not_after && $record->not_after->lt(Carbon::now())) {
return response()->json(['msg' => '该优惠券已过期'], 403);
}
推荐文章: