답변 1개
lib/shop.lib.php
Copy
// 상품의 재고 (창고재고수량 - 주문대기수량)
function get_it_stock_qty($it_id)
{
global $g5;
$sql = " select it_stock_qty from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$row = sql_fetch($sql);
$jaego = (int)$row['it_stock_qty'];
// 재고에서 빼지 않았고 주문인것만
$sql = " select SUM(ct_qty) as sum_qty
from {$g5['g5_shop_cart_table']}
where it_id = '$it_id'
and io_id = ''
and ct_stock_use = 0
and ct_status in ('주문', '입금', '준비') ";
$row = sql_fetch($sql);
$daegi = (int)$row['sum_qty'];
return $jaego - $daegi;
}
// 옵션의 재고 (창고재고수량 - 주문대기수량)
function get_option_stock_qty($it_id, $io_id, $type)
{
global $g5;
$sql = " select io_stock_qty
from {$g5['g5_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'];
// 재고에서 빼지 않았고 주문인것만
$sql = " select SUM(ct_qty) as sum_qty
from {$g5['g5_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);
$daegi = (int)$row['sum_qty'];
return $jaego - $daegi;
}
위 코드 중에서
and ct_status in ('쇼핑', '주문', '입금', '준비') ";
쇼핑을 추가해주세요.
답변을 작성하려면 로그인이 필요합니다.