mirror of
https://github.com/v2board/v2board.git
synced 2025-03-13 06:04:42 +08:00
update: add inventory limit
This commit is contained in:
parent
8a8c6dd116
commit
aa65440556
@ -13,17 +13,15 @@ class PlanService
|
||||
$this->plan = Plan::lockForUpdate()->find($planId);
|
||||
}
|
||||
|
||||
public function incrementInventory()
|
||||
public function incrementInventory(): bool
|
||||
{
|
||||
if ($this->plan->inventory_limit !== NULL) {
|
||||
if ($this->plan->inventory_limit !== NULL) return true;
|
||||
return $this->plan->increment('inventory_limit');
|
||||
}
|
||||
}
|
||||
|
||||
public function decrementInventory()
|
||||
public function decrementInventory(): bool
|
||||
{
|
||||
if ($this->plan->inventory_limit !== NULL) {
|
||||
if ($this->plan->inventory_limit !== NULL) return true;
|
||||
return $this->plan->decrement('inventory_limit');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user