From 6a941223d1682db814c5f5f6f550a6d7e9242d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 8 Aug 2023 10:27:44 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Controllers/EcommerceController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Controllers/EcommerceController.php b/app/Controllers/EcommerceController.php index fe295dd..b8319a1 100644 --- a/app/Controllers/EcommerceController.php +++ b/app/Controllers/EcommerceController.php @@ -85,11 +85,11 @@ class EcommerceController extends Controller //상품정보 가져오기 $product = $this->getProductModel()->getEntity([$this->getProductModel()->getPrimaryKey() => $this->_viewDatas['fieldDatas']['product_uid']]); //재고수 비교 - if ($product->getStock() < $this->_viewDatas['fieldDatas']['quantity']) { - throw new \Exception("구매수량이 너무 많습니다.\n구매수량:{$this->_viewDatas['fieldDatas']['quantity']}개, 남은 재고수량:{$product->getStock()}개"); + if ($product->stock < $this->_viewDatas['fieldDatas']['quantity']) { + throw new \Exception("구매수량이 너무 많습니다.\n구매수량:{$this->_viewDatas['fieldDatas']['quantity']}개, 남은 재고수량:{$product->stock}개"); } //구매 금액 비교 - $price = $product->getPrice() * $this->_viewDatas['fieldDatas']['quantity']; + $price = $product->price * $this->_viewDatas['fieldDatas']['quantity']; if ($price != $this->_viewDatas['fieldDatas']['price']) { throw new \Exception("실 상품금액{$price} 와 구매금액{$this->_viewDatas['fieldDatas']['price']}이 서로 다릅니다."); }