#209 PC 및 관리자 쿠폰 기능 추가
This commit is contained in:
@ -33,6 +33,7 @@ define(_MISU_QUERY_, "
|
||||
count(distinct a.od_id) as ordercount, /* 주문서건수 */
|
||||
count(b.ct_id) as itemcount, /* 상품건수 */
|
||||
(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(b.cp_amount) + a.od_coupon) as couponamount, /* 쿠폰합계*/
|
||||
(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, /* 입금취소 */
|
||||
@ -41,8 +42,9 @@ define(_MISU_QUERY_, "
|
||||
(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)
|
||||
) as misu /* 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소 */");
|
||||
(a.od_refund_amount + a.od_cancel_card) -
|
||||
(SUM(b.cp_amount) + a.od_coupon)
|
||||
) as misu /* 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소 - 쿠폰합계 */");
|
||||
//------------------------------------------------------------------------------
|
||||
// 쇼핑몰 상수 모음 끝
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@ -265,4 +265,13 @@ if(!$result) {
|
||||
ADD `od_coupon` INT(11) NOT NULL DEFAULT '0' AFTER `od_dc_amount`,
|
||||
ADD `od_send_coupon` INT(11) NOT NULL DEFAULT '0' AFTER `od_send_cost` ", false);
|
||||
}
|
||||
|
||||
// 쿠폰사용정보필드추가
|
||||
$sql = " select od_id from {$g4['shop_coupon_table']} limit 1 ";
|
||||
$result = sql_query($sql, false);
|
||||
if(!$result) {
|
||||
sql_query(" ALTER TABLE `{$g4['shop_coupon_table']}`
|
||||
ADD `od_id` BIGINT(20) UNSIGNED NOT NULL AFTER `cp_maximum`,
|
||||
ADD `cp_used_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `cp_used` ", false);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user