매출현황에서 금액계산 쿼리 수정

This commit is contained in:
chicpro
2013-06-12 10:25:45 +09:00
parent 3d7f0e6888
commit 993fe2b396
4 changed files with 9 additions and 9 deletions

View File

@ -53,8 +53,8 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$lines[$i] = $row;
// 장바구니 상태별 금액
$sql1 = " select (SUM(ct_price * ct_qty)) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_price * ct_qty, 0))) as ordercancel /* 주문취소 */
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where uq_id = '{$row['uq_id']}' ";
$row1 = sql_fetch($sql1);