|
diff --git a/adm/shop_admin/configformupdate.php b/adm/shop_admin/configformupdate.php
index 99d489a52..45669528c 100644
--- a/adm/shop_admin/configformupdate.php
+++ b/adm/shop_admin/configformupdate.php
@@ -148,6 +148,7 @@ $sql = " update {$g4['shop_default_table']}
de_sms_hp = '$de_sms_hp',
de_item_ps_use = '$de_item_ps_use',
de_code_dup_use = '$de_code_dup_use',
+ de_cart_keep_term = '$de_cart_keep_term',
de_guest_cart_use = '$de_guest_cart_use',
de_point_per = '$de_point_per',
de_admin_buga_no = '$de_admin_buga_no',
diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php
index c37ce5976..a1a622b2b 100644
--- a/adm/shop_admin/orderform.php
+++ b/adm/shop_admin/orderform.php
@@ -21,12 +21,11 @@ include_once(G4_ADMIN_PATH.'/admin.head.php');
//------------------------------------------------------------------------------
// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제
//------------------------------------------------------------------------------
-if (!isset($cart_not_delete)) {
- if (!$hours) $hours = 6;
- $beforehours = date("Y-m-d H:i:s", ( G4_SERVER_TIME - (60 * 60 * $hours) ) );
- $sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforehours' ";
- sql_query($sql);
-}
+$keep_term = $default['de_cart_keep_term'];
+if (!$keep_term) $keep_term = 15; // 기본값 15일
+$beforetime = date('Y-m-d H:i:s', ( G4_SERVER_TIME - (86400 * $keep_term) ) );
+$sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforetime' ";
+sql_query($sql);
//------------------------------------------------------------------------------
diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php
index fef4d0400..1c4bcd94c 100644
--- a/extend/shop.extend2.php
+++ b/extend/shop.extend2.php
@@ -204,6 +204,7 @@ if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
ADD `mb_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `uq_id` ", false);
sql_query(" ALTER TABLE `{$g4['shop_default_table']}`
- ADD `de_guest_cart_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_code_dup_use` ", false);
+ ADD `de_cart_keep_term` INT(11) NOT NULL DEFAULT '0' AFTER `de_code_dup_use`,
+ ADD `de_guest_cart_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_cart_keep_term` ", false);
}
?>
\ No newline at end of file
diff --git a/install/install_db.php b/install/install_db.php
index 419f1fa9d..16dbaac96 100644
--- a/install/install_db.php
+++ b/install/install_db.php
@@ -263,6 +263,7 @@ if($shop_install) {
de_card_use = '0',
de_card_max_amount = '1000',
de_point_settle = '10000',
+ de_cart_keep_term = '15',
de_point_per = '5',
de_card_point = '0',
de_point_days = '7',
diff --git a/install/shop.sql b/install/shop.sql
index f97818765..9c7037d30 100644
--- a/install/shop.sql
+++ b/install/shop.sql
@@ -249,6 +249,7 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
`de_item_ps_use` tinyint(4) NOT NULL DEFAULT '0',
`de_code_dup_use` tinyint(4) NOT NULL DEFAULT '0',
+ `de_cart_keep_term` int(11) NOT NULL DEFAULT '0',
`de_guest_cart_use` tinyint(4) NOT NULL DEFAULT '0',
`de_point_per` tinyint(4) NOT NULL DEFAULT '0',
`de_admin_buga_no` varchar(255) NOT NULL DEFAULT '',
diff --git a/mobile/shop/orderinquiry.sub.php b/mobile/shop/orderinquiry.sub.php
index f9d583859..89f4c097f 100644
--- a/mobile/shop/orderinquiry.sub.php
+++ b/mobile/shop/orderinquiry.sub.php
@@ -21,7 +21,7 @@ $sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
- where mb_id = '{$member['mb_id']}'
+ where a.mb_id = '{$member['mb_id']}'
group by a.od_id
order by a.od_id desc
$limit ";
diff --git a/shop/cart.php b/shop/cart.php
index 37d5c70d7..6e3c559e4 100644
--- a/shop/cart.php
+++ b/shop/cart.php
@@ -1,6 +1,23 @@
'$ctime' ";
+ sql_query($sql);
+}
+
if (G4_IS_MOBILE) {
include_once(G4_MSHOP_PATH.'/cart.php');
return;
diff --git a/shop/cartupdate.php b/shop/cartupdate.php
index 45d5f7bdf..d717c6f03 100644
--- a/shop/cartupdate.php
+++ b/shop/cartupdate.php
@@ -336,7 +336,7 @@ else // 장바구니에 담기
$ct_count = 0;
$comma = '';
$sql = " INSERT INTO {$g4['shop_cart_table']}
- ( uq_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_direct )
+ ( uq_id, mb_id, it_id, it_name, ct_status, ct_price, ct_point, ct_point_use, ct_stock_use, ct_option, ct_qty, ct_num, io_id, io_type, io_price, ct_time, ct_ip, ct_direct )
VALUES ";
for($i=0; $i<$option_count; $i++) {
@@ -357,7 +357,7 @@ else // 장바구니에 담기
continue;
}
- $sql .= $comma."( '$tmp_uq_id', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct' )";
+ $sql .= $comma."( '$tmp_uq_id', '{$member['mb_id']}', '{$_POST['it_id']}', '{$_POST['it_name']}', '쇼핑', '{$_POST['it_price']}', '{$_POST['it_point']}', '0', '0', '{$_POST['io_value'][$i]}', '{$_POST['ct_qty'][$i]}', '$ct_num', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct' )";
$comma = ' , ';
$ct_num++;
$ct_count++;
diff --git a/shop/orderinquiry.sub.php b/shop/orderinquiry.sub.php
index 86810db3b..bc8fec84d 100644
--- a/shop/orderinquiry.sub.php
+++ b/shop/orderinquiry.sub.php
@@ -23,7 +23,7 @@ $sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
- where mb_id = '{$member['mb_id']}'
+ where a.mb_id = '{$member['mb_id']}'
group by a.od_id
order by a.od_id desc
$limit ";
|