update: fix coupon

This commit is contained in:
tokumeikoi
2021-08-29 12:54:15 +09:00
parent b38f7979d6
commit e5e7a06514
4 changed files with 5 additions and 72 deletions

View File

@ -17,7 +17,7 @@ class CouponService
$this->coupon = Coupon::where('code', $code)->first();
}
public function use(Order $order)
public function use(Order $order):bool
{
$this->setPlanId($order->plan_id);
$this->setUserId($order->user_id);
@ -59,7 +59,7 @@ class CouponService
$this->userId = $userId;
}
public function checkLimitUseWithUser()
public function checkLimitUseWithUser():bool
{
$usedCount = Order::where('coupon_id', $this->coupon->id)
->where('user_id', $this->userId)