#190 장바구니 mb_id 필드 추가
This commit is contained in:
@ -856,6 +856,13 @@ $pg_anchor = '<ul class="anchor">
|
|||||||
안내메세지 출력 사용
|
안내메세지 출력 사용
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><label for="de_cart_keep_term">장바구니 보관기간</label></th>
|
||||||
|
<td>
|
||||||
|
<?php echo help("장바구니 상품의 보관 기간을 설정하십시오."); ?>
|
||||||
|
<input type="text" name="de_cart_keep_term" value="<?php echo $default['de_cart_keep_term']; ?>" id="de_cart_keep_term" class="frm_input" size="5"> 일
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="de_guest_cart_use">비회원 장바구니</label></th>
|
<th scope="row"><label for="de_guest_cart_use">비회원 장바구니</label></th>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@ -148,6 +148,7 @@ $sql = " update {$g4['shop_default_table']}
|
|||||||
de_sms_hp = '$de_sms_hp',
|
de_sms_hp = '$de_sms_hp',
|
||||||
de_item_ps_use = '$de_item_ps_use',
|
de_item_ps_use = '$de_item_ps_use',
|
||||||
de_code_dup_use = '$de_code_dup_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_guest_cart_use = '$de_guest_cart_use',
|
||||||
de_point_per = '$de_point_per',
|
de_point_per = '$de_point_per',
|
||||||
de_admin_buga_no = '$de_admin_buga_no',
|
de_admin_buga_no = '$de_admin_buga_no',
|
||||||
|
|||||||
@ -21,12 +21,11 @@ include_once(G4_ADMIN_PATH.'/admin.head.php');
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제
|
// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
if (!isset($cart_not_delete)) {
|
$keep_term = $default['de_cart_keep_term'];
|
||||||
if (!$hours) $hours = 6;
|
if (!$keep_term) $keep_term = 15; // 기본값 15일
|
||||||
$beforehours = date("Y-m-d H:i:s", ( G4_SERVER_TIME - (60 * 60 * $hours) ) );
|
$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 <= '$beforehours' ";
|
$sql = " delete from {$g4['shop_cart_table']} where ct_status = '$cart_title1' and ct_time <= '$beforetime' ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
}
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -204,6 +204,7 @@ if(!$result) {
|
|||||||
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
|
sql_query(" ALTER TABLE `{$g4['shop_cart_table']}`
|
||||||
ADD `mb_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `uq_id` ", false);
|
ADD `mb_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `uq_id` ", false);
|
||||||
sql_query(" ALTER TABLE `{$g4['shop_default_table']}`
|
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);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -263,6 +263,7 @@ if($shop_install) {
|
|||||||
de_card_use = '0',
|
de_card_use = '0',
|
||||||
de_card_max_amount = '1000',
|
de_card_max_amount = '1000',
|
||||||
de_point_settle = '10000',
|
de_point_settle = '10000',
|
||||||
|
de_cart_keep_term = '15',
|
||||||
de_point_per = '5',
|
de_point_per = '5',
|
||||||
de_card_point = '0',
|
de_card_point = '0',
|
||||||
de_point_days = '7',
|
de_point_days = '7',
|
||||||
|
|||||||
@ -249,6 +249,7 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
|
|||||||
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
|
`de_iche_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||||
`de_item_ps_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_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_guest_cart_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||||
`de_point_per` tinyint(4) NOT NULL DEFAULT '0',
|
`de_point_per` tinyint(4) NOT NULL DEFAULT '0',
|
||||||
`de_admin_buga_no` varchar(255) NOT NULL DEFAULT '',
|
`de_admin_buga_no` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
|||||||
@ -21,7 +21,7 @@ $sql = " select a.od_id,
|
|||||||
a.*, "._MISU_QUERY_."
|
a.*, "._MISU_QUERY_."
|
||||||
from {$g4['shop_order_table']} a
|
from {$g4['shop_order_table']} a
|
||||||
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
|
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
|
group by a.od_id
|
||||||
order by a.od_id desc
|
order by a.od_id desc
|
||||||
$limit ";
|
$limit ";
|
||||||
|
|||||||
@ -1,6 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
|
// 회원일 경우 자신의 장바구니 상품 uq_id 값을 변경
|
||||||
|
if($is_member) {
|
||||||
|
$tmp_uq_id = get_session('ss_uq_id');
|
||||||
|
if(!$tmp_uq_id) {
|
||||||
|
$tmp_uq_id = get_uniqid();
|
||||||
|
set_session('ss_uq_id', $tmp_uq_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ctime = date('Y-m-d H:i:s', (G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400)));
|
||||||
|
$sql = " update {$g4['shop_cart_table']}
|
||||||
|
set uq_id = '$tmp_uq_id'
|
||||||
|
where mb_id = '{$member['mb_id']}'
|
||||||
|
and ct_status = '쇼핑'
|
||||||
|
and ct_time > '$ctime' ";
|
||||||
|
sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
if (G4_IS_MOBILE) {
|
if (G4_IS_MOBILE) {
|
||||||
include_once(G4_MSHOP_PATH.'/cart.php');
|
include_once(G4_MSHOP_PATH.'/cart.php');
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -336,7 +336,7 @@ else // 장바구니에 담기
|
|||||||
$ct_count = 0;
|
$ct_count = 0;
|
||||||
$comma = '';
|
$comma = '';
|
||||||
$sql = " INSERT INTO {$g4['shop_cart_table']}
|
$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 ";
|
VALUES ";
|
||||||
|
|
||||||
for($i=0; $i<$option_count; $i++) {
|
for($i=0; $i<$option_count; $i++) {
|
||||||
@ -357,7 +357,7 @@ else // 장바구니에 담기
|
|||||||
continue;
|
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 = ' , ';
|
$comma = ' , ';
|
||||||
$ct_num++;
|
$ct_num++;
|
||||||
$ct_count++;
|
$ct_count++;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ $sql = " select a.od_id,
|
|||||||
a.*, "._MISU_QUERY_."
|
a.*, "._MISU_QUERY_."
|
||||||
from {$g4['shop_order_table']} a
|
from {$g4['shop_order_table']} a
|
||||||
left join {$g4['shop_cart_table']} b on (b.uq_id=a.uq_id)
|
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
|
group by a.od_id
|
||||||
order by a.od_id desc
|
order by a.od_id desc
|
||||||
$limit ";
|
$limit ";
|
||||||
|
|||||||
Reference in New Issue
Block a user