From 476119f53a100693c8bc246af658293627ed8a8b Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 27 Aug 2013 10:46:26 +0900 Subject: [PATCH] =?UTF-8?q?cart=20=ED=85=8C=EC=9D=B4=EB=B8=94=EC=9D=98=20c?= =?UTF-8?q?t=5Fnum=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/orderform.php | 4 ++-- adm/shop_admin/orderlist2.php | 6 +++--- adm/shop_admin/orderprintresult.php | 6 +++--- extend/shop.extend2.php | 11 +---------- install/shop.sql | 4 +--- lib/shop.lib.php | 2 +- mobile/shop/cart.php | 4 ++-- mobile/shop/orderform.php | 4 ++-- mobile/shop/orderformupdate.php | 6 +++--- mobile/shop/orderinquiryview.php | 4 ++-- shop/boxcart.inc.php | 4 ++-- shop/cart.php | 4 ++-- shop/cartoption.php | 4 ++-- shop/cartupdate.php | 16 ++-------------- shop/orderform.php | 4 ++-- shop/orderformupdate.php | 6 +++--- shop/orderinquiryview.php | 10 +++++----- shop/ordermail1.inc.php | 5 +++-- shop/ordermail2.inc.php | 6 +++--- 19 files changed, 44 insertions(+), 66 deletions(-) diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php index f511f5621..d42f654e2 100644 --- a/adm/shop_admin/orderform.php +++ b/adm/shop_admin/orderform.php @@ -96,7 +96,7 @@ $sql = " select it_id, ct_notax from {$g4['shop_cart_table']} where od_id = '{$od['od_id']}' - and ct_num = '0' + group by it_id order by ct_id "; $result = sql_query($sql); @@ -173,7 +173,7 @@ $pg_anchor .='
  • 결제상세정보 확인
  • from {$g4['shop_cart_table']} where od_id = '{$od['od_id']}' and it_id = '{$row['it_id']}' - order by ct_num "; + order by io_type asc, ct_id asc "; $res = sql_query($sql); for($k=0; $opt=sql_fetch_array($res); $k++) { diff --git a/adm/shop_admin/orderlist2.php b/adm/shop_admin/orderlist2.php index 693cc1b09..020f44e03 100644 --- a/adm/shop_admin/orderlist2.php +++ b/adm/shop_admin/orderlist2.php @@ -199,8 +199,8 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌 $sql2 = " select it_id, it_name from {$g4['shop_cart_table']} where od_id = '{$row['od_id']}' - and ct_num = '0' - order by ct_num "; + group by it_id + order by ct_id asc "; $result2 = sql_query($sql2); for ($k=0;$row2=sql_fetch_array($result2);$k++) { // for 자식 시작 @@ -231,7 +231,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌 from {$g4['shop_cart_table']} where od_id = '{$row['od_id']}' and it_id = '{$row2['it_id']}' - order by ct_num "; + order by io_type asc, ct_id asc "; $result3 = sql_query($sql3); for($j=0;$row3=sql_fetch_array($result3);$j++) { // for 손자 시작 diff --git a/adm/shop_admin/orderprintresult.php b/adm/shop_admin/orderprintresult.php index 85f10695f..ac1aadddc 100644 --- a/adm/shop_admin/orderprintresult.php +++ b/adm/shop_admin/orderprintresult.php @@ -48,7 +48,7 @@ if ($csv == 'csv') $sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' "; if ($ct_status) $sql .= " and b.ct_status = '$ct_status' "; - $sql .=" order by od_time asc "; + $sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id "; $result = sql_query($sql); $cnt = @mysql_num_rows($result); if (!$cnt) @@ -106,7 +106,7 @@ if ($csv == 'xls') $sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' "; if ($ct_status) $sql .= " and b.ct_status = '$ct_status' "; - $sql .=" order by od_time asc "; + $sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id "; $result = sql_query($sql); $cnt = @mysql_num_rows($result); if (!$cnt) @@ -278,7 +278,7 @@ if (mysql_num_rows($result) == 0) where od_id = '{$row['od_id']}' "; if ($ct_status) $sql2 .= " and ct_status = '$ct_status' "; - $sql2 .= " order by ct_id "; + $sql2 .= " order by it_id, io_type, ct_id "; $res2 = sql_query($sql2); $cnt = $sub_tot_qty = $sub_tot_amount = 0; diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php index 8b1527494..f1f400393 100644 --- a/extend/shop.extend2.php +++ b/extend/shop.extend2.php @@ -72,20 +72,11 @@ $result = sql_query($sql, false); if(!$result) { sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` ADD `ct_option` VARCHAR(255) NOT NULL DEFAULT '' AFTER `ct_stock_use`, - ADD `ct_num` INT(11) NOT NULL DEFAULT '0' AFTER `ct_qty`, ADD `io_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `ct_qty`, ADD `io_type` TINYINT(4) NOT NULL DEFAULT '0' AFTER `io_id`, ADD `io_price` INT(11) NOT NULL DEFAULT '0' AFTER `io_type` ", false); } -// ct_num 추가 -$sql = " select ct_num from {$g4['shop_cart_table']} limit 1 "; -$result = sql_query($sql, false); -if(!$result) { - sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` - ADD `ct_num` INT(11) NOT NULL DEFAULT '0' AFTER `ct_qty` ", false); -} - // it_brand 추가 $sql = " select it_brand from {$g4['shop_item_table']} limit 1 "; $result = sql_query($sql, false); @@ -380,7 +371,7 @@ $sql = " select ct_notax from {$g4['shop_cart_table']} limit 1 "; $result = sql_query($sql, false); if(!$result) { sql_query(" ALTER TABLE `{$g4['shop_cart_table']}` - ADD `ct_notax` TINYINT(4) NOT NULL DEFAULT '0' AFTER `ct_num` ", true); + ADD `ct_notax` TINYINT(4) NOT NULL DEFAULT '0' AFTER `ct_qty` ", true); } */ diff --git a/install/shop.sql b/install/shop.sql index 5e6577fc0..b08a8aaeb 100644 --- a/install/shop.sql +++ b/install/shop.sql @@ -67,7 +67,6 @@ CREATE TABLE IF NOT EXISTS `shop_cart` ( `ct_stock_use` tinyint(4) NOT NULL DEFAULT '0', `ct_option` varchar(255) NOT NULL DEFAULT '', `ct_qty` int(11) NOT NULL DEFAULT '0', - `ct_num` int(11) NOT NULL DEFAULT '0', `ct_notax` tinyint(4) NOT NULL DEFAULT '0', `io_id` varchar(255) NOT NULL DEFAULT '', `io_type` tinyint(4) NOT NULL DEFAULT '0', @@ -78,8 +77,7 @@ CREATE TABLE IF NOT EXISTS `shop_cart` ( `ct_direct` tinyint(4) NOT NULL DEFAULT '0', `ct_select` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`ct_id`), - KEY `od_id` (`od_id`), - KEY `ct_num` (`ct_num`) + KEY `od_id` (`od_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 5dcc6d86e..2bce24630 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -1063,7 +1063,7 @@ function print_item_options($it_id, $cart_id) { global $g4; - $sql = " select ct_option, ct_qty from {$g4['shop_cart_table']} where it_id = '$it_id' and od_id = '$cart_id' order by io_type asc, ct_num asc, ct_id asc "; + $sql = " select ct_option, ct_qty from {$g4['shop_cart_table']} where it_id = '$it_id' and od_id = '$cart_id' order by io_type asc, ct_id asc "; $result = sql_query($sql); $str = ''; diff --git a/mobile/shop/cart.php b/mobile/shop/cart.php index 8fba8a88d..51e48be44 100644 --- a/mobile/shop/cart.php +++ b/mobile/shop/cart.php @@ -38,12 +38,12 @@ include_once(G4_MSHOP_PATH.'/_head.php'); a.ct_send_cost, b.ca_id from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id ) - where a.od_id = '$s_cart_id' - and a.ct_num = '0' "; + where a.od_id = '$s_cart_id' "; if($default['de_cart_keep_term']) { $ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400)); $sql .= " and a.ct_time > '$ctime' "; } + $sql .= " group by a.it_id "; $sql .= " order by a.ct_id "; $result = sql_query($sql); diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index abb27284f..c7f706091 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -72,12 +72,12 @@ ob_start(); b.it_notax from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id ) where a.od_id = '$s_cart_id' - and a.ct_select = '1' - and a.ct_num = '0' "; + and a.ct_select = '1' "; if($default['de_cart_keep_term']) { $ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400)); $sql .= " and a.ct_time > '$ctime' "; } + $sql .= " group by a.it_id "; $sql .= " order by a.ct_id "; $result = sql_query($sql); diff --git a/mobile/shop/orderformupdate.php b/mobile/shop/orderformupdate.php index fe3d922c9..c290b3333 100644 --- a/mobile/shop/orderformupdate.php +++ b/mobile/shop/orderformupdate.php @@ -201,11 +201,10 @@ if ($default['de_send_cost_case'] == '없음') { } } else { // 개별배송비 $send_cost = 0; - $sql = " select it_id + $sql = " select distinct it_id from {$g4['shop_cart_table']} where od_id = '$tmp_cart_id' and ct_select = '1' - and ct_num = '0' and ct_send_cost = '0' "; $result = sql_query($sql); for($i=0; $sc=sql_fetch_array($result); $i++) { @@ -520,7 +519,8 @@ if($is_member) { where od_id = '$od_id' and it_id = '$cp_it_id' and ct_select = '1' - and ct_num = '0' "; + order by ct_id asc + limit 1 "; sql_query($sql); } diff --git a/mobile/shop/orderinquiryview.php b/mobile/shop/orderinquiryview.php index 59ec5c0e7..10056bb6f 100644 --- a/mobile/shop/orderinquiryview.php +++ b/mobile/shop/orderinquiryview.php @@ -57,7 +57,7 @@ include_once(G4_MSHOP_PATH.'/_head.php'); $sql = " select it_id, it_name, cp_amount from {$g4['shop_cart_table']} where od_id = '$od_id' - and ct_num = '0' + group by it_id order by ct_id "; $result = sql_query($sql); ?> @@ -89,7 +89,7 @@ include_once(G4_MSHOP_PATH.'/_head.php'); from {$g4['shop_cart_table']} where od_id = '$od_id' and it_id = '{$row['it_id']}' - order by ct_num "; + order by it_type asc, ct_id asc "; $res = sql_query($sql); $ct_list = array(); diff --git a/shop/boxcart.inc.php b/shop/boxcart.inc.php index 9ed5ddc8b..0697283f0 100644 --- a/shop/boxcart.inc.php +++ b/shop/boxcart.inc.php @@ -8,8 +8,8 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가