mirror of
https://github.com/v2board/v2board.git
synced 2025-06-14 21:57:50 +08:00
coupon plan limit
This commit is contained in:
@ -26,6 +26,13 @@ class CouponController extends Controller
|
||||
if (time() > $coupon->ended_at) {
|
||||
abort(500, '优惠券已过期');
|
||||
}
|
||||
if ($coupon->limit_plan_ids) {
|
||||
$limitPlanIds = json_decode($coupon->limit_plan_ids);
|
||||
info($limitPlanIds);
|
||||
if (!in_array($request->input('plan_id'), $limitPlanIds)) {
|
||||
abort(500, '这个计划无法使用该优惠码');
|
||||
}
|
||||
}
|
||||
return response([
|
||||
'data' => $coupon
|
||||
]);
|
||||
|
Reference in New Issue
Block a user