검색의 판매량 많은순에서 상품을 정렬하기 위해 판매된 상품의 합산 수량을 배송에서 완료 상태로 변경시 update

This commit is contained in:
gnuboard
2013-11-08 18:08:04 +09:00
parent b99775727c
commit 02fc807576

View File

@ -239,6 +239,17 @@ for ($i=0; $i<count($_POST['chk']); $i++)
case '배송' :
if ($change_status != '완료') continue;
change_status($od_id, '배송', '완료');
// 완료인 경우에만 상품구입 합계수량을 상품테이블에 저장한다.
$sql2 = " select ct_id, ct_qty from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ";
$result2 = sql_query($sql2);
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
$sql3 = " select it_id, sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where ct_id = '{$row2['ct_id']}' ";
$row3 = sql_fetch($sql3);
$sql4 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row3['sum_qty']}' where it_id = '{$row3['it_id']}' ";
sql_query($sql4);
}
break;
} // switch end