coupon plan limit

This commit is contained in:
Tokumeikoi
2020-06-13 23:27:43 +08:00
parent 3cdfc69b5d
commit bbb42c0d46
6 changed files with 36 additions and 21 deletions

View File

@ -43,6 +43,12 @@ class CouponService
return false;
}
}
if ($this->coupon->limit_plan_ids) {
$limitPlanIds = json_decode($this->coupon->limit_plan_ids);
if (!in_array($order->plan_id, $limitPlanIds)) {
return false;
}
}
return true;
}
}