";
- }
- $it_name .= "";
+ $it_name = "$it_name ({$row2['ct_option']})";
$fontqty1 = $fontqty2 = "";
if ($row2['ct_qty'] >= 2)
diff --git a/adm/shop_admin/orderstatuslist.php b/adm/shop_admin/orderstatuslist.php
index 15e09236f..5adde70ce 100644
--- a/adm/shop_admin/orderstatuslist.php
+++ b/adm/shop_admin/orderstatuslist.php
@@ -48,26 +48,15 @@ $sql = " select a.od_id,
a.od_deposit_name,
a.od_time,
a.od_mobile,
- b.it_opt1,
- b.it_opt2,
- b.it_opt3,
- b.it_opt4,
- b.it_opt5,
- b.it_opt6,
b.ct_status,
b.ct_qty,
b.ct_price,
b.ct_point,
- (b.ct_qty * b.ct_price) as ct_sub_amount,
+ b.ct_option,
+ (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) as ct_sub_amount,
(b.ct_qty * b.ct_point) as ct_sub_point,
b.it_id,
- b.it_name,
- c.it_opt1_subject,
- c.it_opt2_subject,
- c.it_opt3_subject,
- c.it_opt4_subject,
- c.it_opt5_subject,
- c.it_opt6_subject
+ b.it_name
$sql_common
order by $sort1 $sort2
limit $from_record, $rows ";
@@ -183,7 +172,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
- |
+
|
'.$lines[$i]['od_deposit_name']?>
diff --git a/extend/shop.extend.php b/extend/shop.extend.php
index 4b18402d9..a0db96aff 100644
--- a/extend/shop.extend.php
+++ b/extend/shop.extend.php
@@ -32,13 +32,13 @@ if (G4_HTTPS_DOMAIN) {
define(_MISU_QUERY_, "
count(distinct a.od_id) as ordercount, /* 주문서건수 */
count(b.ct_id) as itemcount, /* 상품건수 */
- (SUM(b.ct_price * b.ct_qty) + a.od_send_cost) as orderamount , /* 주문합계 */
- (SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', b.ct_price * b.ct_qty, 0))) as ordercancel, /* 주문취소 */
+ (SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost) as orderamount, /* 주문합계 */
+ (SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) as ordercancel, /* 주문취소 */
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) as receiptamount, /* 입금합계 */
(a.od_refund_amount + a.od_cancel_card) as receiptcancel, /* 입금취소 */
(
- (SUM(b.ct_price * b.ct_qty) + a.od_send_cost) -
- (SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', b.ct_price * b.ct_qty, 0))) -
+ (SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost) -
+ (SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) -
a.od_dc_amount -
(a.od_receipt_bank + a.od_receipt_card + a.od_receipt_hp + a.od_receipt_point) +
(a.od_refund_amount + a.od_cancel_card)
diff --git a/install/shop.sql b/install/shop.sql
index 004dd05fe..a37343594 100644
--- a/install/shop.sql
+++ b/install/shop.sql
@@ -74,9 +74,9 @@ CREATE TABLE IF NOT EXISTS `shop_cart` (
`ct_ip` varchar(25) NOT NULL DEFAULT '',
`ct_send_cost` varchar(255) NOT NULL,
`ct_direct` tinyint(4) NOT NULL,
- `ct_order` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`ct_id`),
- KEY `uq_id` (`uq_id`)
+ KEY `uq_id` (`uq_id`),
+ KEY `ct_num` (`ct_num`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
diff --git a/shop/cartupdate.php b/shop/cartupdate.php
index df3e33785..45d5f7bdf 100644
--- a/shop/cartupdate.php
+++ b/shop/cartupdate.php
@@ -217,11 +217,11 @@ else if ($act == "optionmod") // 장바구니에서 옵션변경
// 장바구니에 Insert
$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, ct_order )
+ ( 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 )
VALUES ";
for($i=0; $i<$option_count; $i++) {
- $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]}', '$i', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct', '{$_POST['ct_order']}' )";
+ $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]}', '$i', '{$_POST['io_id'][$i]}', '{$_POST['io_type'][$i]}', '{$_POST['io_price'][$i]}', '".G4_TIME_YMDHIS."', '$REMOTE_ADDR', '$sw_direct' )";
$comma = ' , ';
}
@@ -333,18 +333,38 @@ else // 장바구니에 담기
else
$ct_num = 0;
+ $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 )
VALUES ";
for($i=0; $i<$option_count; $i++) {
+ // 동일옵션의 상품이 있으면 수량 더함
+ $sql2 = " select ct_id
+ from {$g4['shop_cart_table']}
+ where uq_id = '$tmp_uq_id'
+ and it_id = '{$_POST['it_id']}'
+ and io_id = '{$_POST['io_id'][$i]}'
+ and ct_status = '쇼핑' ";
+ $row2 = sql_fetch($sql2);
+ if($row2['ct_id']) {
+ $sql3 = " update {$g4['shop_cart_table']}
+ set ct_qty = ct_qty + {$_POST['ct_qty'][$i]}
+ where ct_id = '{$row2['ct_id']}' ";
+ sql_query($sql3);
+
+ 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' )";
$comma = ' , ';
$ct_num++;
+ $ct_count++;
}
- sql_query($sql);
+ if($ct_count > 0)
+ sql_query($sql);
}
}
|