Merge branch 'master' into shopskin

Conflicts:
	lib/shop.lib.php
This commit is contained in:
gnuboard
2013-07-25 11:16:30 +09:00
29 changed files with 293 additions and 812 deletions

View File

@ -15,7 +15,6 @@ $menu['menu400'] = array (
array('400620', '상품재고관리', G4_ADMIN_URL.'/shop_admin/itemstocklist.php', 'scf_item_stock'),
array('400610', '상품유형관리', G4_ADMIN_URL.'/shop_admin/itemtypelist.php', 'scf_item_type'),
array('400500', '상품옵션재고관리', G4_ADMIN_URL.'/shop_admin/optionstocklist.php', 'scf_item_option'),
array('400490', '마일리지관리', G4_ADMIN_URL.'/shop_admin/mileagelist.php', 'scf_mileage'),
array('400650', '쿠폰관리', G4_ADMIN_URL.'/shop_admin/couponlist.php', 'scf_coupon'),
array('400500', '배송일괄처리', G4_ADMIN_URL.'/shop_admin/deliverylist.php', 'scf_deli', 1),
array('400740', '배송업체관리', G4_ADMIN_URL.'/shop_admin/deliverycodelist.php', 'scf_deli_co', 1),

View File

@ -488,13 +488,6 @@ $pg_anchor = '<ul class="anchor">
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="de_mileage_use">마일리지 사용</label></th>
<td>
<?php echo help("마일리지는 주문완료에 의해 적립되는 포인트입니다.\n마일리지 사용으로 설정하시면 기존 포인트 대신 마일리지가 주문 결제에 사용됩니다."); ?>
<input type="checkbox" name="de_mileage_use" value="1" id="de_mileage_use" <?php echo $default['de_mileage_use']?' checked':''; ?>> 사용
</td>
</tr>
<tr>
<th scope="row"><label for="cf_use_point">포인트 사용</label></th>
<td>
@ -560,13 +553,6 @@ $pg_anchor = '<ul class="anchor">
<label for="de_escrow_use2"> 에스크로결제 사용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="de_tax_flag_use">복합과세 결제</label></th>
<td>
<?php echo help("복합과세(과세, 비과세) 결제를 사용하려면 체크하십시오.\n복합과세 결제를 사용하기 전 KCP에 결제 신청을 해주셔야 합니다."); ?>
<input type="checkbox" name="de_tax_flag_use" value="1" id="de_tax_flag_use"<?php echo $default['de_tax_flag_use']?' checked':''; ?>> 사용
</td>
</tr>
<tr>
<th scope="row">신용카드 결제테스트</th>
<td>
@ -605,6 +591,13 @@ $pg_anchor = '<ul class="anchor">
</script>
</td>
</tr>
<tr>
<th scope="row"><label for="de_tax_flag_use">복합과세 결제</label></th>
<td>
<?php echo help("복합과세(과세, 비과세) 결제를 사용하려면 체크하십시오.\n복합과세 결제를 사용하기 전 KCP에 결제 신청을 해주셔야 합니다."); ?>
<input type="checkbox" name="de_tax_flag_use" value="1" id="de_tax_flag_use"<?php echo $default['de_tax_flag_use']?' checked':''; ?>> 사용
</td>
</tr>
<tr>
<th scope="row">공통 URL</th>
<td>

View File

@ -100,7 +100,6 @@ $sql = " update {$g4['shop_default_table']}
de_card_point = '$de_card_point',
de_card_pg = '$de_card_pg',
de_card_max_amount = '$de_card_max_amount',
de_mileage_use = '$de_mileage_use',
de_point_settle = '$de_point_settle',
de_level_sell = '$de_level_sell',
de_send_cost_case = '$de_send_cost_case',

View File

@ -17,6 +17,12 @@ if ($w == "u")
$ev = sql_fetch($sql);
if (!$ev['ev_id'])
alert("등록된 자료가 없습니다.");
// 등록된 이벤트 상품
$sql = " select b.it_id, b.it_name
from {$g4['shop_event_item_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.ev_id = '$ev_id' ";
$res_item = sql_query($sql);
}
else
{
@ -34,12 +40,31 @@ else
$ev['ev_list_row'] = 5;
}
// 분류리스트
$category_select = '';
$sql = " select * from {$g4['shop_category_table']} ";
if ($is_admin != 'super')
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
$sql .= " order by ca_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$len = strlen($row['ca_id']) / 2 - 1;
$nbsp = "";
for ($i=0; $i<$len; $i++)
$nbsp .= "&nbsp;&nbsp;&nbsp;";
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
}
include_once (G4_ADMIN_PATH.'/admin.head.php');
?>
<form name="feventform" action="./itemeventformupdate.php" onsubmit="return feventform_check(this);" method="post" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="w" value="<?php echo $w; ?>">
<input type="hidden" name="ev_id" value="<?php echo $ev_id; ?>">
<input type="hidden" name="ev_item" value="">
<section class="cbox">
<h2><?php echo $html_title; ?></h2>
@ -137,6 +162,46 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
?>
</td>
</tr>
<tr>
<td colspan="2">
<section>
<h3>상품검색</h3>
<div>
<select name="ca_id" id="sch_ca_id">
<option value="">분류선택</option>
<?php echo $category_select; ?>
</select>
</div>
<div id="sch_item_list">
</div>
</section>
<section>
<h3>등록된 상품</h3>
<div id="reg_item_list">
<?php
for($i=0; $row=sql_fetch_array($res_item); $i++) {
$it_name = get_it_image($row['it_id'], 50, 50).' '.$row['it_name'];
if($i==0)
echo '<ul>';
?>
<li>
<input type="hidden" name="it_id[]" value="<?php echo $row['it_id']; ?>">
<?php echo $it_name; ?>
<button type="button" class="del_item">삭제</button>
</li>
<?php
}
if($i > 0)
echo '</ul>';
else
echo '등록된 상품이 없습니다.';
?>
</div>
</section>
</td>
</tr>
<tr>
<th scope="row"><label for="ev_himg">상단이미지</label></th>
<td>
@ -211,8 +276,69 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
</form>
<script>
$(function() {
$("#sch_ca_id").change(function() {
var ca_id = $(this).val();
$("#sch_item_list").load(
"./itemeventsearch.php",
{ w: "<?php echo $w; ?>", ev_id: "<?php echo $ev_id; ?>", ca_id: ca_id }
);
});
$("#sch_item_list .add_item").live("click", function() {
// 이미 등록된 상품인지 체크
var it_id = $(this).closest("li").find("input:hidden").val();
var it_id2;
var dup = false;
$("#reg_item_list input[name='it_id[]']").each(function() {
it_id2 = $(this).val();
if(it_id == it_id2) {
dup = true;
return false;
}
});
if(dup) {
alert("이미 등록된 상품입니다.");
return false;
}
var cont = "<li>"+$(this).closest("li").html().replace("add_item", "del_item").replace("추가", "삭제")+"</li>";
var count = $("#reg_item_list li").size();
if(count > 0) {
$("#reg_item_list li:last").after(cont);
} else {
$("#reg_item_list").html("<ul>"+cont+"</ul>");
}
});
$("#reg_item_list .del_item").live("click", function() {
if(!confirm("상품을 삭제하시겠습니까?"))
return false;
$(this).closest("li").remove();
});
});
function feventform_check(f)
{
var item = new Array();
var ev_item = it_id = "";
$("#reg_item_list input[name='it_id[]']").each(function() {
it_id = $(this).val();
if(it_id == "")
return true;
item.push(it_id);
});
if(item.length > 0)
ev_item = item.join();
$("input[name=ev_item]").val(ev_item);
<?php echo get_editor_js('ev_head_html'); ?>
<?php echo get_editor_js('ev_tail_html'); ?>

View File

@ -51,6 +51,10 @@ else if ($w == "d")
@unlink(G4_DATA_PATH."/event/{$ev_id}_h");
@unlink(G4_DATA_PATH."/event/{$ev_id}_t");
// 이벤트상품삭제
$sql = " delete from {$g4['shop_event_item_table']} where ev_id = '$ev_id' ";
sql_query($sql);
$sql = " delete from {$g4['shop_event_table']} where ev_id = '$ev_id' ";
sql_query($sql);
}
@ -61,6 +65,24 @@ if ($w == "" || $w == "u")
if ($_FILES['ev_himg']['name']) upload_file($_FILES['ev_himg']['tmp_name'], $ev_id."_h", G4_DATA_PATH."/event");
if ($_FILES['ev_timg']['name']) upload_file($_FILES['ev_timg']['tmp_name'], $ev_id."_t", G4_DATA_PATH."/event");
// 등록된 이벤트 상품 먼저 삭제
$sql = " delete from {$g4['shop_event_item_table']} where ev_id = '$ev_id' ";
sql_query($sql);
// 이벤트 상품등록
$item = explode(',', $ev_item);
$count = count($item);
for($i=0; $i<$count; $i++) {
$it_id = $item[$i];
if($it_id) {
$sql = " insert into {$g4['shop_event_item_table']}
set ev_id = '$ev_id',
it_id = '$it_id' ";
sql_query($sql);
}
}
goto_url("./itemeventform.php?w=u&amp;ev_id=$ev_id");
}
else

View File

@ -0,0 +1,38 @@
<?php
$sub_menu = '400630';
include_once('./_common.php');
auth_check($auth[$sub_menu], "w");
if(!trim($_POST['ca_id']))
die("");
$sql = " select it_id, it_name
from {$g4['shop_item_table']}
where ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' )
order by ca_id, it_name ";
$result = sql_query($sql);
$list = '';
for($i=0;$row=sql_fetch_array($result);$i++) {
if($w == 'u') {
$sql2 = " select count(*) as cnt from {$g4['shop_event_item_table']} where ev_id = '$ev_id' and it_id = '{$row['it_id']}' ";
$row2 = sql_fetch($sql2);
if ($row2['cnt'])
continue;
}
$it_name = get_it_image($row['it_id'], 50, 50).' '.$row['it_name'];
$list .= '<li>';
$list .= '<input type="hidden" name="it_id[]" value="'.$row['it_id'].'">';
$list .= $it_name;
$list .= '<button type="button" class="add_item">추가</button>';
$list .= '</li>'.PHP_EOL;
}
if($list)
$list = '<ul>'.$list.'</ul>';
echo $list;
?>

View File

@ -40,7 +40,7 @@ include_once(G4_PATH.'/head.sub.php');
</a>
</td>
<td class="td_smallmng"><?php echo ($row['it_use']?"사용":"미사용"); ?></td>
<td class="td_smallmng"><a href="javascript:del('./itemeventwindel.php?ev_id=$ev_id&amp;it_id=<?php echo $row['it_id']; ?>');"><img src="./img/icon_del.jpg" alt="<?php echo $ev['ev_subject']; ?> 이벤트에서 삭제 : <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?>"></a></td>
<td class="td_smallmng"><a href="javascript:del('./itemeventwindel.php?ev_id=<?php echo $ev_id; ?>&amp;it_id=<?php echo $row['it_id']; ?>');"><img src="./img/icon_del.jpg" alt="<?php echo $ev['ev_subject']; ?> 이벤트에서 삭제 : <?php echo cut_str(stripslashes($row['it_name']), 60, "&#133"); ?>"></a></td>
<tr>
<?php
}

View File

@ -4,8 +4,8 @@ include_once('./_common.php');
$sql = " select ca_id, it_id, it_name, it_price
from {$g4['shop_item_table']}
where ca_id like '$ca_id%'
and it_id <> '$it_id'
where it_id <> '$it_id'
and ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' )
order by ca_id, it_name ";
$result = sql_query($sql);
@ -21,11 +21,6 @@ for($i=0;$row=sql_fetch_array($result);$i++) {
$ca_name = addslashes($row2['ca_name']);
$it_name = addslashes($row['it_name']);
if(file_exists(G4_DATA_PATH."/item/{$row['it_id']}_s"))
$it_image = "{$row['it_id']}_s";
else
$it_image = "";
$options .= "<option value=\"".$row['it_id']."\">$ca_name : $it_name</option>\n";
}

View File

@ -119,8 +119,8 @@ if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
<option value="it_sell_email" <?php echo get_selected($sfl, 'it_sell_email'); ?>>판매자 e-mail</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="frm_input required">
<label for="stx" class="sound_only">검색어</label>
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" class="frm_input">
<input type="submit" value="검색" class="btn_submit">
</fieldset>

View File

@ -1,231 +0,0 @@
<?php
$sub_menu = "400490";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
$token = get_token();
$sql_common = " from {$g4['shop_mileage_table']} ";
$sql_search = " where (1) ";
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case 'mb_id' :
$sql_search .= " ({$sfl} = '{$stx}') ";
break;
default :
$sql_search .= " ({$sfl} like '%{$stx}%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "ml_id";
$sod = "desc";
}
$sql_order = " order by {$sst} {$sod} ";
$sql = " select count(*) as cnt
{$sql_common}
{$sql_search}
{$sql_order} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == '') $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
{$sql_common}
{$sql_search}
{$sql_order}
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
$listall = '';
if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
$listall = '<a href="'.$_SERVER['PHP_SELF'].'">전체목록</a>';
$mb = array();
if ($sfl == 'mb_id' && $stx)
$mb = get_member($stx);
$g4['title'] = '마일리지관리';
include_once (G4_ADMIN_PATH.'/admin.head.php');
$colspan = 8;
?>
<form name="fsearch" id="fsearch" method="get">
<fieldset>
<legend>마일리지 내역 검색</legend>
<span>
<?php echo $listall ?>
전체 <?php echo number_format($total_count) ?> 건
<?php
if (isset($mb['mb_id']) && $mb['mb_id']) {
echo '&nbsp;(' . $mb['mb_id'] .' 님 마일리지 합계 : ' . number_format($mb['mb_mileage']) . '점)';
} else {
$row2 = sql_fetch(" select sum(ml_point) as sum_mileage from {$g4['shop_mileage_table']} ");
echo '&nbsp;(전체 합계 '.number_format($row2['sum_mileage']).'점)';
}
?>
</span>
<select name="sfl" title="검색대상">
<option value="mb_id"<?php echo get_selected($_GET['sfl'], "mb_id"); ?>>회원아이디</option>
<option value="sp_content"<?php echo get_selected($_GET['sfl'], "ml_content"); ?>>내용</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
<input type="submit" class="btn_submit" value="검색">
</fieldset>
</form>
<section class="cbox">
<h2>마일리지 내역</h2>
<ul class="sort_odr">
<li><?php echo subject_sort_link('mb_id') ?>회원아이디<span class="sound_only"> 순 정렬</span></a></li>
<li><?php echo subject_sort_link('ml_datetime') ?>일시<span class="sound_only"> 순 정렬</span></a></li>
<li><?php echo subject_sort_link('ml_content') ?>내용<span class="sound_only"> 순 정렬</span></a></li>
<li><?php echo subject_sort_link('ml_point') ?>마일리지<span class="sound_only"> 순 정렬</span></a></li>
</ul>
<form name="fpointlist" id="fpointlist" method="post" action="./mileagelist_delete.php" onsubmit="return fmileagelist_submit(this);">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<table class="tbl_pt_list">
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">마일리지 내역 전체</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col">회원아이디</th>
<th scope="col">이름</th>
<th scope="col">별명</th>
<th scope="col">일시</th>
<th scope="col">마일리지 내용</th>
<th scope="col">마일리지</th>
<th scope="col">마일리지합</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i==0 || ($row2['mb_id'] != $row['mb_id'])) {
$sql2 = " select mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_mileage from {$g4['member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
}
$mb_nick = get_sideview($row['mb_id'], $row2['mb_nick'], $row2['mb_email'], $row2['mb_homepage']);
$link1 = '<a href="./orderform.php?od_id='.$row['od_id'].'">';
$link2 = '</a>';
?>
<tr>
<td class="td_chk">
<input type="hidden" name="mb_id[<?php echo $i ?>]" value="<?php echo $row['mb_id'] ?>" id="mb_id_<?php echo $i ?>">
<input type="hidden" name="ml_id[<?php echo $i ?>]" value="<?php echo $row['ml_id'] ?>" id="ml_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only">내역</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_mbid"><a href="?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td>
<td class="td_mbname"><?php echo $row2['mb_name'] ?></td>
<td class="td_name sv_use"><div><?php echo $mb_nick ?></div></td>
<td class="td_time"><?php echo $row['ml_datetime'] ?></td>
<td class="td_pt_log"><?php echo $link1 ?><?php echo $row['ml_content'] ?><?php echo $link2 ?></td>
<td class="td_num td_pt"><?php echo number_format($row['ml_point']) ?></td>
<td class="td_bignum td_pt"><?php echo number_format($row2['mb_mileage']) ?></td>
</tr>
<?php
}
if ($i == 0)
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
</table>
<div class="btn_list">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div>
</form>
</section>
<?php echo get_paging(G4_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page="); ?>
<section id="point_mng" class="cbox">
<h2>개별회원 마일리지 증감 설정</h2>
<form name="fmileagelist2" method="post" id="fmileagelist2" action="./mileageupdate.php" autocomplete="off">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<table class="frm_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="mb_id">회원아이디<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_id" value="<?php echo $mb_id ?>" id="mb_id" class="required frm_input" required></td>
</tr>
<tr>
<th scope="row"><label for="ml_content">마일리지 내용<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="ml_content" id="ml_content" required class="required frm_input" size="80"></td>
</tr>
<tr>
<th scope="row"><label for="ml_point">마일리지<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="ml_point" id="ml_point" required class="required frm_input"></td>
</tr>
</tbody>
</table>
<div class="btn_confirm">
<input type="submit" value="확인" class="btn_submit">
</div>
</form>
</section>
<script>
function fmileagelist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>
<?php
include_once (G4_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -1,32 +0,0 @@
<?php
$sub_menu = "400490";
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], 'd');
check_token();
$count = count($_POST['chk']);
if(!$count)
alert("선택삭제 하실 항목을 하나이상 선택해 주세요.");
for ($i=0; $i<$count; $i++)
{
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$sql = " delete from {$g4['shop_mileage_table']} where ml_id = '{$_POST['ml_id'][$k]}' ";
sql_query($sql);
$sql = " select sum(ml_point) as sum_ml_point from {$g4['shop_mileage_table']} where mb_id = '{$_POST['mb_id'][$k]}' ";
$row = sql_fetch($sql);
$sum_mileage = $row['sum_ml_point'];
$sql= " update {$g4['member_table']} set mb_mileage = '{$sum_mileage}' where mb_id = '{$_POST['mb_id'][$k]}' ";
sql_query($sql);
}
goto_url('./mileagelist.php?'.$qstr);
?>

View File

@ -1,24 +0,0 @@
<?php
$sub_menu = "400490";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'w');
check_token();
$mb_id = $_POST['mb_id'];
$ml_point = $_POST['ml_point'];
$ml_content = $_POST['ml_content'];
$mb = get_member($mb_id);
if (!$mb['mb_id'])
alert('존재하는 회원아이디가 아닙니다.', './mileagelist.php?'.$qstr);
if (($ml_point < 0) && ($ml_point * (-1) > $mb['mb_mileage']))
alert('포인트를 깎는 경우 현재 마일리지보다 작으면 안됩니다.', './mileagelist.php?'.$qstr);
insert_mileage($mb_id, $ml_point, $ml_content, '', '');
goto_url('./mileagelist.php?'.$qstr);
?>

View File

@ -141,11 +141,7 @@ for ($i=0; $i<$cnt; $i++)
{
$point_use = 0;
//insert_point($mb_id, (-1) * ($ct[ct_point] * $ct[ct_qty]), "주문번호 $od_id ($ct_id) 취소");
if(!$default['de_mileage_use'])
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$uq_id,$ct_id");
// 마일리지 삭제
delete_mileage($mb_id, $od_id, $ct_id);
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$uq_id,$ct_id");
}
// 히스토리에 남김

View File

@ -21,7 +21,7 @@ include_once(G4_ADMIN_PATH.'/admin.head.php');
// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제
//------------------------------------------------------------------------------
$keep_term = $default['de_cart_keep_term'];
if (!$keep_term) $keep_term = 1; // 기본값 1일
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);
@ -48,16 +48,9 @@ if (!isset($order_not_point)) {
// 회원이면서 포인트가 0보다 크다면
if ($tmp_row['mb_id'] && $row['ct_point'] > 0)
{
if(!$default['de_mileage_use']) {
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['uq_id']},{$row['ct_id']}");
}
// 주문완료 마일리지 적립
$ml_point = $row['ct_point'] * $row['ct_qty'];
$ml_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_mileage($tmp_row['mb_id'], $ml_point, $ml_content, $tmp_row['od_id'], $row['ct_id']);
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['uq_id']},{$row['ct_id']}");
}
sql_query("update {$g4['shop_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");