From 295a7ded24b9f82b34ea6d5707bfe800d7f50133 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 12 Sep 2013 11:59:58 +0900 Subject: [PATCH 1/5] =?UTF-8?q?cp=5Fused=20=ED=95=84=EB=93=9C=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/couponformupdate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adm/shop_admin/couponformupdate.php b/adm/shop_admin/couponformupdate.php index b9d993eb0..b0d0a7635 100644 --- a/adm/shop_admin/couponformupdate.php +++ b/adm/shop_admin/couponformupdate.php @@ -77,9 +77,9 @@ if($w == '') { } while(1); $sql = " INSERT INTO {$g4['shop_coupon_table']} - ( cp_id, cp_subject, cp_method, cp_target, mb_id, cp_start, cp_end, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum, cp_used, cp_datetime ) + ( cp_id, cp_subject, cp_method, cp_target, mb_id, cp_start, cp_end, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum, cp_datetime ) VALUES - ( '$cp_id', '$cp_subject', '$cp_method', '$cp_target', '$mb_id', '$cp_start', '$cp_end', '$cp_type', '$cp_price', '$cp_trunc', '$cp_minimum', '$cp_maximum', '$cp_used', '".G4_TIME_YMDHIS."' ) "; + ( '$cp_id', '$cp_subject', '$cp_method', '$cp_target', '$mb_id', '$cp_start', '$cp_end', '$cp_type', '$cp_price', '$cp_trunc', '$cp_minimum', '$cp_maximum', '".G4_TIME_YMDHIS."' ) "; sql_query($sql); } else if($w == 'u') { From 9d342b33f831c386deb350c6eec3933681cc180e Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 12 Sep 2013 13:09:04 +0900 Subject: [PATCH 2/5] =?UTF-8?q?#292=20cp=5Fused=20=ED=95=84=EB=93=9C?= =?UTF-8?q?=EC=99=80=20=EA=B4=80=EB=A0=A8=EB=90=9C=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/couponlist.php | 1 - mobile/shop/mypage.php | 13 +++++++++---- mobile/shop/orderformupdate.php | 6 ++---- shop/coupon.php | 14 +++++++++----- shop/mypage.php | 16 +++++++++------- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/adm/shop_admin/couponlist.php b/adm/shop_admin/couponlist.php index 47e02b52a..575a9a93d 100644 --- a/adm/shop_admin/couponlist.php +++ b/adm/shop_admin/couponlist.php @@ -81,7 +81,6 @@ $colspan = 8;
diff --git a/mobile/shop/mypage.php b/mobile/shop/mypage.php index 5d4701b77..51a500a4f 100644 --- a/mobile/shop/mypage.php +++ b/mobile/shop/mypage.php @@ -8,13 +8,18 @@ $g4['title'] = '마이페이지'; include_once(G4_MSHOP_PATH.'/_head.php'); // 쿠폰 -$sql = " select count(*) as cnt +$cp_count = 0; +$sql = " select cp_id from {$g4['shop_coupon_table']} where mb_id = '{$member['mb_id']}' - and cp_used = '0' and cp_start <= '".G4_TIME_YMD."' and cp_end >= '".G4_TIME_YMD."' "; -$cp = sql_fetch($sql); +$res = sql_query($sql); + +for($k=0; $cp=sql_fetch_array($res); $k++) { + if(!is_used_coupon($member['mb_id'], $cp['cp_id'])) + $cp_count++; +} ?>
@@ -26,7 +31,7 @@ $cp = sql_fetch($sql);
보유포인트
보유쿠폰
-
+
연락처
E-Mail
diff --git a/mobile/shop/orderformupdate.php b/mobile/shop/orderformupdate.php index 3a388d1e6..825ac0b1d 100644 --- a/mobile/shop/orderformupdate.php +++ b/mobile/shop/orderformupdate.php @@ -151,10 +151,9 @@ if($is_member) { $sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum from {$g4['shop_coupon_table']} where cp_id = '{$_POST['od_cp_id']}' - and mb_id = '{$member['mb_id']}' + and mb_id IN ( '{$member['mb_id']}', '전체회원' ) and cp_start <= '".G4_TIME_YMD."' and cp_end >= '".G4_TIME_YMD."' - and cp_used = '0' and cp_method = '2' "; $cp = sql_fetch($sql); @@ -197,10 +196,9 @@ if($is_member && $send_cost > 0) { $sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum from {$g4['shop_coupon_table']} where cp_id = '{$_POST['sc_cp_id']}' - and mb_id = '{$member['mb_id']}' + and mb_id IN ( '{$member['mb_id']}', '전체회원' ) and cp_start <= '".G4_TIME_YMD."' and cp_end >= '".G4_TIME_YMD."' - and cp_used = '0' and cp_method = '3' "; $cp = sql_fetch($sql); diff --git a/shop/coupon.php b/shop/coupon.php index 0c0267a35..002c32085 100644 --- a/shop/coupon.php +++ b/shop/coupon.php @@ -10,15 +10,10 @@ include_once(G4_PATH.'/head.sub.php'); $sql = " select cp_id, cp_subject, cp_method, cp_target, cp_start, cp_end, cp_type, cp_price from {$g4['shop_coupon_table']} where mb_id = '{$member['mb_id']}' - and cp_used = '0' and cp_start <= '".G4_TIME_YMD."' and cp_end >= '".G4_TIME_YMD."' order by cp_no "; $result = sql_query($sql); - -$count = @mysql_num_rows($result); -if(!$count) - alert_close('보유하신 쿠폰이 없습니다.'); ?> @@ -36,7 +31,11 @@ if(!$count) @@ -64,6 +65,9 @@ if(!$count) 사용할 수 있는 쿠폰이 없습니다.'; ?> diff --git a/shop/mypage.php b/shop/mypage.php index 2bc3f5008..ead01790c 100644 --- a/shop/mypage.php +++ b/shop/mypage.php @@ -12,17 +12,19 @@ if (!$is_member) $g4['title'] = $member['mb_name'].'님 마이페이지'; include_once('./_head.php'); -//$str = $g4[title]; -//include("./navigation2.inc.php"); - // 쿠폰 -$sql = " select count(*) as cnt +$cp_count = 0; +$sql = " select cp_id from {$g4['shop_coupon_table']} where mb_id = '{$member['mb_id']}' - and cp_used = '0' and cp_start <= '".G4_TIME_YMD."' and cp_end >= '".G4_TIME_YMD."' "; -$cp = sql_fetch($sql); +$res = sql_query($sql); + +for($k=0; $cp=sql_fetch_array($res); $k++) { + if(!is_used_coupon($member['mb_id'], $cp['cp_id'])) + $cp_count++; +} ?> @@ -45,7 +47,7 @@ $cp = sql_fetch($sql);
보유포인트
보유쿠폰
-
+
연락처
E-Mail
From d674b3181430433219da492441c4169646a6ac01 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 12 Sep 2013 13:36:18 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EC=A3=BC=EB=AC=B8=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EC=97=90=EC=84=9C=20=EC=B7=A8=EC=86=8C=EA=B8=88?= =?UTF-8?q?=EC=95=A1=20=ED=91=9C=EC=8B=9C=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=EC=98=A4=EB=A5=98=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/index.php | 4 +- adm/shop_admin/ordercartupdate.php | 72 ++++++++++++++++++++++++++++++ adm/shop_admin/orderlist.php | 13 +++--- adm/shop_admin/orderlist2.php | 15 ++++--- adm/shop_admin/sale1date.php | 13 +++--- adm/shop_admin/sale1month.php | 13 +++--- adm/shop_admin/sale1today.php | 13 +++--- adm/shop_admin/sale1year.php | 15 ++++--- mobile/shop/orderinquiry.sub.php | 2 +- shop/orderinquiry.sub.php | 2 +- 10 files changed, 120 insertions(+), 42 deletions(-) diff --git a/adm/shop_admin/index.php b/adm/shop_admin/index.php index 018192c31..96885a0d6 100644 --- a/adm/shop_admin/index.php +++ b/adm/shop_admin/index.php @@ -119,7 +119,7 @@ $pg_anchor = '
    - + 수정 @@ -131,7 +131,7 @@ $pg_anchor = '
      diff --git a/adm/shop_admin/ordercartupdate.php b/adm/shop_admin/ordercartupdate.php index fce4a9548..779d7a957 100644 --- a/adm/shop_admin/ordercartupdate.php +++ b/adm/shop_admin/ordercartupdate.php @@ -158,6 +158,78 @@ for ($i=0; $i<$cnt; $i++) sql_query($sql); } +// 주문정보 +$sql = " select * from {$g4['shop_order_table']} where od_id = '$od_id' "; +$od = sql_fetch($sql); + +// 주문 합계 +$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(cp_price) as coupon + from {$g4['shop_cart_table']} + where od_id = '$od_id' + and ct_status IN ( '주문', '준비', '배송', '완료' ) "; +$sum = sql_fetch($sql); +$cart_price = $sum['price']; +$cart_coupon = $sum['coupon']; + +// 주문할인 쿠폰 +$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum + from {$g4['shop_coupon_table']} + where od_id = '$od_id' + and cp_method = '2' "; +$cp = sql_fetch($sql); + +if($cp['cp_id']) { + $dc = 0; + $tot_od_price = $cart_price - $cart_coupon; + + if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_price)) { + if($cp['cp_type']) { + $dc = floor(($tot_od_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc']; + } else { + $dc = $cp['cp_price']; + } + + if($cp['cp_maximum'] && $dc > $cp['cp_maximum']) + $dc = $cp['cp_maximum']; + + if($tot_od_price < $dc) + $dc = $tot_od_price; + } +} + +// 배송비 +$send_cost = get_sendcost($cart_price, $od_id); + +// 취소 합계 +$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price, + SUM(cp_price) as coupon + from {$g4['shop_cart_table']} + where od_id = '$od_id' + and ct_status IN ( '취소', '반품', '품절' ) "; +$sum = sql_fetch($sql); +$cancel_price = $sum['price']; +$cancel_coupon = $sum['coupon']; + +// 배송비가 배송비 쿠폰보다 작다면 쿠폰금액으로 설정 +if($send_cost < $od['od_send_coupon']) + $send_cost = $od['od_send_coupon']; + +// 미수 +$od_misu = $od['od_cart_price'] + $send_cost + $od['od_send_cost2'] + - ($od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon']) + - ($od['od_receipt_price'] + $od['od_receipt_point']) + + $cancel_coupon + + ($od['od_coupon'] - $dc); + +// 주문정보 반영 +$sql = " update {$g4['shop_order_table']} + set od_cancel_price = '$cancel_price', + od_send_cost = '$send_cost', + od_misu = '$od_misu' + where od_id = '$od_id' "; +sql_query($sql); + $qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page"; $url = "./orderform.php?od_id=$od_id&$qstr"; diff --git a/adm/shop_admin/orderlist.php b/adm/shop_admin/orderlist.php index 3f6a1ae9e..35100b666 100644 --- a/adm/shop_admin/orderlist.php +++ b/adm/shop_admin/orderlist.php @@ -63,7 +63,8 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 -$sql = " select * +$sql = " select *, + (od_cart_coupon + od_coupon + od_send_coupon) as couponprice $sql_common order by $sort1 $sort2 limit $from_record, $rows "; @@ -132,7 +133,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
    • ">미수금 순 정렬
    - 주문상태 : + 주문상태 :
    • @@ -205,10 +206,10 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
      누적 - + - + @@ -221,7 +222,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌 $tot_orderprice += $row['od_cart_price']; $tot_ordercancel += $row['od_cancel_price']; $tot_receiptprice += $row['od_receipt_price']; - $tot_couponamount += $row['couponamount']; + $tot_couponprice += $row['couponprice']; $tot_misu += $row['od_misu']; } mysql_free_result($result); @@ -236,7 +237,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌 - + diff --git a/adm/shop_admin/orderlist2.php b/adm/shop_admin/orderlist2.php index 327e08b20..2697ed720 100644 --- a/adm/shop_admin/orderlist2.php +++ b/adm/shop_admin/orderlist2.php @@ -37,7 +37,8 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 -$sql = " select * +$sql = " select *, + (od_cart_coupon + od_coupon + od_send_coupon) as couponprice $sql_common order by $sort1 $sort2 limit $from_record, $rows "; @@ -126,7 +127,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌 $tot_orderprice += $row['od_cart_price']; $tot_ordercancel += $row['od_cancel_price']; $tot_receiptprice += $row['od_receipt_price']; - $tot_couponamount += $row['couponamount']; + $tot_couponprice += $row['couponprice']; $tot_misu += $row['misu']; $uid = md5($row['od_id'].$row['od_time'].$row['od_ip']); @@ -161,13 +162,13 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
      주문합계
      -
      +
      결제수단
      입금합계
      쿠폰사용
      -
      +
      주문취소
      미수금
      @@ -279,10 +280,10 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌 건 - - + + - + diff --git a/adm/shop_admin/sale1date.php b/adm/shop_admin/sale1date.php index bfb41b383..b954b0c86 100644 --- a/adm/shop_admin/sale1date.php +++ b/adm/shop_admin/sale1date.php @@ -37,7 +37,8 @@ $sql = " select od_id, od_cart_price, od_cancel_price, od_misu, - (od_cart_coupon + od_coupon + od_send_coupon) as couponamount + (od_cart_price + od_send_cost + od_send_cost2) as orderprice, + (od_cart_coupon + od_coupon + od_send_coupon) as couponprice from {$g4['shop_order_table']} where SUBSTRING(od_time,1,10) between '$fr_date' and '$to_date' order by od_time desc "; @@ -77,9 +78,9 @@ $result = sql_query($sql); } $save['ordercount']++; - $save['orderprice'] += $row['od_cart_price']; + $save['orderprice'] += $row['orderprice']; $save['ordercancel'] += $row['od_cancel_price']; - $save['ordercoupon'] += $row['couponamount']; + $save['ordercoupon'] += $row['couponprice']; if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체') $save['receiptbank'] += $row['od_receipt_price']; if($row['od_settle_case'] == '신용카드') @@ -88,9 +89,9 @@ $result = sql_query($sql); $save['misu'] += $row['od_misu']; $tot['ordercount']++; - $tot['orderprice'] += $row['od_cart_price']; - $tot['ordercancel'] += $row1['od_cancel_price']; - $tot['ordercoupon'] += $row['couponamount']; + $tot['orderprice'] += $row['orderprice']; + $tot['ordercancel'] += $row['od_cancel_price']; + $tot['ordercoupon'] += $row['couponprice']; if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체') $tot['receiptbank'] += $row['od_receipt_price']; if($row['od_settle_case'] == '신용카드') diff --git a/adm/shop_admin/sale1month.php b/adm/shop_admin/sale1month.php index fae5bc06b..12d08ab61 100644 --- a/adm/shop_admin/sale1month.php +++ b/adm/shop_admin/sale1month.php @@ -23,7 +23,7 @@ function print_line($save) - + - - + + @@ -72,9 +73,9 @@ $result = sql_query($sql); - + /orderinquiryview.php?od_id=&uid="> () - + diff --git a/shop/orderinquiry.sub.php b/shop/orderinquiry.sub.php index 5d1992726..fa71b52d6 100644 --- a/shop/orderinquiry.sub.php +++ b/shop/orderinquiry.sub.php @@ -41,7 +41,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) () - + From dde4c87bbab35c0d31c454762acf833ce5109a6c Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 12 Sep 2013 13:57:54 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=ED=95=84=EB=93=9C=EB=AA=85=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/shop.extend2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php index a03f360f1..d9478aa95 100644 --- a/extend/shop.extend2.php +++ b/extend/shop.extend2.php @@ -480,8 +480,8 @@ if(!sql_query(" select od_cart_count from {$g4['shop_order_table']} limit 1 ", f sql_query(" ALTER TABLE `{$g4['shop_order_table']}` ADD `od_cart_count` int(11) NOT NULL DEFAULT '0' AFTER `od_memo`, ADD `od_cart_price` int(11) NOT NULL DEFAULT '0' AFTER `od_cart_count`, - ADD `od_cart_coupon` int(11) NOT NULL DEFAULT '0' AFTER `od_cart_amount`, - ADD `od_cancel_price` int(11) NOt NULL DEFAULT '0' AFTER `od_receipt_amount`, + ADD `od_cart_coupon` int(11) NOT NULL DEFAULT '0' AFTER `od_cart_price`, + ADD `od_cancel_price` int(11) NOt NULL DEFAULT '0' AFTER `od_receipt_price`, ADD `od_status` varchar(255) NOT NULL DEFAULT '' AFTER `od_mod_history` ", true); } From c380ddf5bafc16493c113ebedf28dbfdecbfcd11 Mon Sep 17 00:00:00 2001 From: whitedot Date: Thu, 12 Sep 2013 14:06:10 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=EC=87=BC=ED=95=91=EB=AA=B0:=20#295=20?= =?UTF-8?q?=EC=83=81=ED=92=88=EC=83=81=EC=84=B8=EB=B3=B4=EA=B8=B0=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/default_shop.css | 2 +- skin/shop/basic/item.form.skin.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/css/default_shop.css b/css/default_shop.css index d39f0c6ba..2188b6dd6 100644 --- a/css/default_shop.css +++ b/css/default_shop.css @@ -460,7 +460,7 @@ td.empty_table {padding:85px 0;text-align:center} #sit_ov_btn {margin:0 0 0 34px !important;margin:0 0 0 33px;padding:0;list-style:none;zoom:1} #sit_ov_btn:after {display:block;visibility:hidden;clear:both;content:""} #sit_ov_btn li {float:left;margin:0 0 0 1px} -#sit_ov_btn a {display:inline-block;padding:10px 0 8px;width:80px;font-size:0.95em;text-align:center;text-decoration:none;letter-spacing:-0.1em} +#sit_ov_btn a, #sit_ov_btn input {display:inline-block;padding:10px 0 8px;width:80px;border:0;font-size:0.95em;text-align:center;text-decoration:none;letter-spacing:-0.1em;cursor:pointer} #sit_btn_buy {background:#ff5b89;color:#fff} #sit_btn_cart, #sit_btn_wish {background:#555;color:#fff} #sit_btn_rec {background:#888;color:#fff} diff --git a/skin/shop/basic/item.form.skin.php b/skin/shop/basic/item.form.skin.php index c06adc03a..f8ca238b1 100644 --- a/skin/shop/basic/item.form.skin.php +++ b/skin/shop/basic/item.form.skin.php @@ -254,8 +254,6 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
    • -
    • 바로구매
    • -
    • 장바구니
    • 위시리스트