From e6acb95aba8d324718db1aa8e0702945f3e799c6 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 27 May 2013 14:36:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=B5=EC=85=98=20=EC=9E=AC=EA=B3=A0=20?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=EC=8B=9C=20=ED=83=80=EC=9E=85=EB=8F=84=20?= =?UTF-8?q?=EB=84=98=EA=B8=B0=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/shop.lib.php | 7 +++++-- shop/cartupdate.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 2e287244c..f3e59be3c 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -167,11 +167,13 @@ function get_it_stock_qty($it_id) } // 옵션의 재고 (창고재고수량 - 주문대기수량) -function get_option_stock_qty($it_id, $io_id) +function get_option_stock_qty($it_id, $io_id, $type) { global $g4; - $sql = " select io_stock_qty from {$g4['shop_item_option_table']} where it_id = '$it_id' and io_id = '$io_id' and io_use = '1' "; + $sql = " select io_stock_qty + from {$g4['shop_item_option_table']} + where it_id = '$it_id' and io_id = '$io_id' and io_type = '$type' and io_use = '1' "; $row = sql_fetch($sql); $jaego = (int)$row['io_stock_qty']; @@ -180,6 +182,7 @@ function get_option_stock_qty($it_id, $io_id) from {$g4['shop_cart_table']} where it_id = '$it_id' and io_id = '$io_id' + and io_type = '$type' and ct_stock_use = 0 and ct_status in ('주문', '준비') "; $row = sql_fetch($sql); diff --git a/shop/cartupdate.php b/shop/cartupdate.php index 2985141e6..2fba3716d 100644 --- a/shop/cartupdate.php +++ b/shop/cartupdate.php @@ -197,7 +197,7 @@ else // 장바구니에 담기 if(!$_POST['io_id'][$i]) $it_stock_qty = get_it_stock_qty($_POST['it_id']); else - $it_stock_qty = get_option_stock_qty($_POST['it_id'], $_POST['io_id'][$i]); + $it_stock_qty = get_option_stock_qty($_POST['it_id'], $_POST['io_id'][$i], $_POST['io_type'][$i]); if ($ct_qty + $sum_qty > $it_stock_qty) {