From e8756f56b61a879c79c336478257aef4a5c93ba7 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 11 Jul 2014 10:16:18 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A1=B0=EA=B1=B4=EB=B6=80=20=EB=AC=B4?= =?UTF-8?q?=EB=A3=8C=20=EC=83=81=ED=92=88=EC=9D=98=20=EA=B2=BD=EC=9A=B0=20?= =?UTF-8?q?=EB=B0=B0=EC=86=A1=EB=B9=84=EA=B0=80=200=EC=9D=BC=20=EB=95=8C?= =?UTF-8?q?=20=EB=AC=B4=EB=A3=8C=EB=A1=9C=20=ED=91=9C=EC=8B=9C=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/ajax.orderitem.php | 11 +++++- adm/shop_admin/orderform.php | 19 +++++++++- adm/shop_admin/orderprintresult.php | 55 +++++++++++++++++++++++++++-- mobile/shop/cart.php | 9 +++++ mobile/shop/orderform.php | 9 +++++ mobile/shop/orderinquiryview.php | 18 +++++++++- shop/cart.php | 9 +++++ shop/orderform.php | 9 +++++ shop/orderinquiryview.php | 18 +++++++++- 9 files changed, 151 insertions(+), 6 deletions(-) diff --git a/adm/shop_admin/ajax.orderitem.php b/adm/shop_admin/ajax.orderitem.php index a1bf428a6..91ba94e12 100644 --- a/adm/shop_admin/ajax.orderitem.php +++ b/adm/shop_admin/ajax.orderitem.php @@ -17,7 +17,8 @@ $sql = " select it_id, it_name, cp_price, ct_notax, - ct_send_cost + ct_send_cost, + it_sc_type from {$g5['g5_shop_cart_table']} where od_id = '$od_id' group by it_id @@ -82,6 +83,14 @@ $result = sql_query($sql); $ct_send_cost = '선불'; break; } + + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } ?> diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php index 883f6244d..037409dff 100644 --- a/adm/shop_admin/orderform.php +++ b/adm/shop_admin/orderform.php @@ -58,7 +58,8 @@ $sql = " select it_id, it_name, cp_price, ct_notax, - ct_send_cost + ct_send_cost, + it_sc_type from {$g5['g5_shop_cart_table']} where od_id = '{$od['od_id']}' group by it_id @@ -165,6 +166,14 @@ if($od['od_pg'] == 'lg') { $res = sql_query($sql); $rowspan = mysql_num_rows($res); + // 합계금액 계산 + $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(ct_qty) as qty + from {$g5['g5_shop_cart_table']} + where it_id = '{$row['it_id']}' + and od_id = '{$od['od_id']}' "; + $sum = sql_fetch($sql); + // 배송비 switch($row['ct_send_cost']) { @@ -179,6 +188,14 @@ if($od['od_pg'] == 'lg') { break; } + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od['od_id']); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + for($k=0; $opt=sql_fetch_array($res); $k++) { if($opt['io_type']) $opt_price = $opt['io_price']; diff --git a/adm/shop_admin/orderprintresult.php b/adm/shop_admin/orderprintresult.php index 77814bfa6..e8a16c013 100644 --- a/adm/shop_admin/orderprintresult.php +++ b/adm/shop_admin/orderprintresult.php @@ -39,7 +39,7 @@ if ($csv == 'csv') $to_date = date_conv($to_date); - $sql = " SELECT od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost + $sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b where a.od_id = b.od_id "; if ($case == 1) // 출력기간 @@ -66,6 +66,15 @@ if ($csv == 'csv') for ($i=0; $row=mysql_fetch_array($result); $i++) { $row = array_map('iconv_euckr', $row); + + // 합계금액 계산 + $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(ct_qty) as qty + from {$g5['g5_shop_cart_table']} + where it_id = '{$row['it_id']}' + and od_id = '{$row['od_id']}' "; + $sum = sql_fetch($sql); + switch($row['ct_send_cost']) { case 1: @@ -78,6 +87,15 @@ if ($csv == 'csv') $ct_send_cost = '선불'; break; } + + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $row['od_id']); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + $ct_send_cost = iconv_euckr($ct_send_cost); echo '"'.$row['od_b_zip1'].'-'.$row['od_b_zip2'].'"'.','; @@ -110,7 +128,7 @@ if ($csv == 'xls') $fr_date = date_conv($fr_date); $to_date = date_conv($to_date); - $sql = " SELECT od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost + $sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b where a.od_id = b.od_id "; if ($case == 1) // 출력기간 @@ -146,6 +164,14 @@ if ($csv == 'xls') } for($i=1; $row=sql_fetch_array($result); $i++) { + // 합계금액 계산 + $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(ct_qty) as qty + from {$g5['g5_shop_cart_table']} + where it_id = '{$row['it_id']}' + and od_id = '{$row['od_id']}' "; + $sum = sql_fetch($sql); + switch($row['ct_send_cost']) { case 1: @@ -158,6 +184,15 @@ if ($csv == 'xls') $ct_send_cost = '선불'; break; } + + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $row['od_id']); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + $ct_send_cost = iconv_euckr($ct_send_cost); $row = array_map('iconv_euckr', $row); @@ -342,6 +377,22 @@ if (mysql_num_rows($result) == 0) break; } + // 합계금액 계산 + $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(ct_qty) as qty + from {$g5['g5_shop_cart_table']} + where it_id = '{$row2['it_id']}' + and od_id = '{$row2['od_id']}' "; + $sum = sql_fetch($sql); + + // 조건부무료 + if($row2['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $row['od_id']); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + $fontqty1 = $fontqty2 = ""; if ($row2['ct_qty'] >= 2) { diff --git a/mobile/shop/cart.php b/mobile/shop/cart.php index 15be25550..15d7fe2f6 100644 --- a/mobile/shop/cart.php +++ b/mobile/shop/cart.php @@ -13,6 +13,7 @@ $sql = " select a.ct_id, a.ct_qty, a.ct_status, a.ct_send_cost, + a.it_sc_type, b.ca_id from {$g5['g5_shop_cart_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id ) where a.od_id = '$s_cart_id' "; @@ -88,6 +89,14 @@ $cart_count = mysql_num_rows($result); break; } + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + $point = $sum['point']; $sell_price = $sum['price']; ?> diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index 15d8b12aa..08501aec3 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -57,6 +57,7 @@ ob_start(); a.ct_qty, a.ct_status, a.ct_send_cost, + a.it_sc_type, b.ca_id, b.ca_id2, b.ca_id3, @@ -180,6 +181,14 @@ ob_start(); $ct_send_cost = '선불'; break; } + + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } ?>
  • diff --git a/mobile/shop/orderinquiryview.php b/mobile/shop/orderinquiryview.php index 828d6ef18..8675e8a15 100644 --- a/mobile/shop/orderinquiryview.php +++ b/mobile/shop/orderinquiryview.php @@ -43,7 +43,7 @@ if($od['od_pg'] == 'lg') { $st_count1 = $st_count2 = 0; $custom_cancel = false; - $sql = " select it_id, it_name, cp_price, ct_send_cost + $sql = " select it_id, it_name, cp_price, ct_send_cost, it_sc_type from {$g5['g5_shop_cart_table']} where od_id = '$od_id' group by it_id @@ -65,6 +65,14 @@ if($od['od_pg'] == 'lg') { order by io_type asc, ct_id asc "; $res = sql_query($sql); + // 합계금액 계산 + $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(ct_qty) as qty + from {$g5['g5_shop_cart_table']} + where it_id = '{$row['it_id']}' + and od_id = '$od_id' "; + $sum = sql_fetch($sql); + // 배송비 switch($row['ct_send_cost']) { @@ -78,6 +86,14 @@ if($od['od_pg'] == 'lg') { $ct_send_cost = '선불'; break; } + + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } ?>
  • diff --git a/shop/cart.php b/shop/cart.php index 569195ea2..ec799ea14 100644 --- a/shop/cart.php +++ b/shop/cart.php @@ -57,6 +57,7 @@ include_once('./_head.php'); a.ct_qty, a.ct_status, a.ct_send_cost, + a.it_sc_type, b.ca_id, b.ca_id2, b.ca_id3 @@ -112,6 +113,14 @@ include_once('./_head.php'); break; } + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + $point = $sum['point']; $sell_price = $sum['price']; ?> diff --git a/shop/orderform.php b/shop/orderform.php index 39ef9ea3b..0d21da4c2 100644 --- a/shop/orderform.php +++ b/shop/orderform.php @@ -85,6 +85,7 @@ require_once('./'.$default['de_pg_service'].'/orderform.1.php'); a.ct_qty, a.ct_status, a.ct_send_cost, + a.it_sc_type, b.ca_id, b.ca_id2, b.ca_id3, @@ -204,6 +205,14 @@ require_once('./'.$default['de_pg_service'].'/orderform.1.php'); $ct_send_cost = '선불'; break; } + + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } ?> diff --git a/shop/orderinquiryview.php b/shop/orderinquiryview.php index e36c9db9e..e1cd86f33 100644 --- a/shop/orderinquiryview.php +++ b/shop/orderinquiryview.php @@ -49,7 +49,7 @@ if($od['od_pg'] == 'lg') { $st_count1 = $st_count2 = 0; $custom_cancel = false; - $sql = " select it_id, it_name, ct_send_cost + $sql = " select it_id, it_name, ct_send_cost, it_sc_type from {$g5['g5_shop_cart_table']} where od_id = '$od_id' group by it_id @@ -86,6 +86,14 @@ if($od['od_pg'] == 'lg') { $res = sql_query($sql); $rowspan = mysql_num_rows($res) + 1; + // 합계금액 계산 + $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(ct_qty) as qty + from {$g5['g5_shop_cart_table']} + where it_id = '{$row['it_id']}' + and od_id = '$od_id' "; + $sum = sql_fetch($sql); + // 배송비 switch($row['ct_send_cost']) { @@ -100,6 +108,14 @@ if($od['od_pg'] == 'lg') { break; } + // 조건부무료 + if($row['it_sc_type'] == 2) { + $sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id); + + if($sendcost == 0) + $ct_send_cost = '무료'; + } + for($k=0; $opt=sql_fetch_array($res); $k++) { if($opt['io_type']) $opt_price = $opt['io_price'];