사용후기 건수 반영후 검색에서 사용후기 많은순으로 기능 추가

This commit is contained in:
gnuboard
2013-11-13 11:42:25 +09:00
parent 07006980da
commit 51ea3bcd0e
8 changed files with 91 additions and 49 deletions

View File

@ -241,14 +241,11 @@ for ($i=0; $i<count($_POST['chk']); $i++)
change_status($od_id, '배송', '완료');
// 완료인 경우에만 상품구입 합계수량을 상품테이블에 저장한다.
$sql2 = " select ct_id, ct_qty from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ";
$sql2 = " select it_id, sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_status = '완료' group by it_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);
$sql3 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row3['sum_qty']}' where it_id = '{$row3['it_id']}' ";
sql_query($sql3);
}
break;