update: add inventory limit

This commit is contained in:
tokumeikoi
2022-06-30 03:18:30 +08:00
parent cc6b07d7b8
commit 8a8c6dd116
3 changed files with 42 additions and 1 deletions

View File

@ -249,6 +249,11 @@ class OrderService
return false;
}
}
$planService = new PlanService($order->plan_id);
if (!$planService->incrementInventory()) {
DB::rollBack();
return false;
}
DB::commit();
return true;
}