답변 1개
7년 전
lib/shop.lib.php
</p>
<p>
// 상품의 재고 (창고재고수량 - 주문대기수량)
function get_it_stock_qty($it_id)
{
global $g5;</p>
<p> $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'];</p>
<p> // 재고에서 빼지 않았고 주문인것만
$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'];</p>
<p> return $jaego - $daegi;
}</p>
<p>
// 옵션의 재고 (창고재고수량 - 주문대기수량)
function get_option_stock_qty($it_id, $io_id, $type)
{
global $g5;</p>
<p> $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'];</p>
<p> // 재고에서 빼지 않았고 주문인것만
$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'];</p>
<p> return $jaego - $daegi;
}</p>
<p>
위 코드 중에서
and ct_status in ('쇼핑', '주문', '입금', '준비') ";
쇼핑을 추가해주세요.
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인