주문현황
입금완료미배송내역
미입금주문내역
사용후기
상품문의
';
// 주문상태에 따른 합계 금액
function get_order_status_sum($status)
{
global $g5;
$sql = " select count(*) as cnt,
sum(od_cart_price + od_send_cost + od_send_cost2 - od_cancel_price) as price
from {$g5['g5_shop_order_table']}
where od_status = '$status' ";
$row = sql_fetch($sql);
$info = array();
$info['count'] = (int)$row['cnt'];
$info['price'] = (int)$row['price'];
$info['href'] = './orderlist.php?od_status='.urlencode($status);
return $info;
}
// 일자별 주문 합계 금액
function get_order_date_sum($date)
{
global $g5;
$sql = " select sum(od_cart_price + od_send_cost + od_send_cost2) as orderprice,
sum(od_cancel_price) as cancelprice
from {$g5['g5_shop_order_table']}
where SUBSTRING(od_time, 1, 10) = '$date' ";
$row = sql_fetch($sql);
$info = array();
$info['order'] = (int)$row['orderprice'];
$info['cancel'] = (int)$row['cancelprice'];
return $info;
}
// 일자별 결제수단 주문 합계 금액
function get_order_settle_sum($date)
{
global $g5, $default;
$case = array('신용카드', '계좌이체', '가상계좌', '무통장', '휴대폰');
$info = array();
// 결제수단별 합계
foreach($case as $val)
{
$sql = " select sum(od_cart_price + od_send_cost + od_send_cost2 - od_receipt_point - od_cart_coupon - od_coupon - od_send_coupon) as price,
count(*) as cnt
from {$g5['g5_shop_order_table']}
where SUBSTRING(od_time, 1, 10) = '$date'
and od_settle_case = '$val' ";
$row = sql_fetch($sql);
$info[$val]['price'] = (int)$row['price'];
$info[$val]['count'] = (int)$row['cnt'];
}
// 포인트 합계
$sql = " select sum(od_receipt_point) as price,
count(*) as cnt
from {$g5['g5_shop_order_table']}
where SUBSTRING(od_time, 1, 10) = '$date'
and od_receipt_point > 0 ";
$row = sql_fetch($sql);
$info['포인트']['price'] = (int)$row['price'];
$info['포인트']['count'] = (int)$row['cnt'];
// 쿠폰 합계
$sql = " select sum(od_cart_coupon + od_coupon + od_send_coupon) as price,
count(*) as cnt
from {$g5['g5_shop_order_table']}
where SUBSTRING(od_time, 1, 10) = '$date'
and ( od_cart_coupon > 0 or od_coupon > 0 or od_send_coupon > 0 ) ";
$row = sql_fetch($sql);
$info['쿠폰']['price'] = (int)$row['price'];
$info['쿠폰']['count'] = (int)$row['cnt'];
return $info;
}
function get_max_value($arr)
{
foreach($arr as $key => $val)
{
if(is_array($val))
{
$arr[$key] = get_max_value($val);
}
}
sort($arr);
return array_pop($arr);
}
?>
주문현황
=0; $i--) {
$date = date('Y-m-d', strtotime('-'.$i.' days', G5_SERVER_TIME));
$x_val[] = $date;
$arr_order[] = get_order_date_sum($date);
}
$max_y = get_max_value($arr_order);
$max_y = ceil(($max_y) / 1000) * 1000;
$y_val = array();
$y_val[] = $max_y;
for($i=4; $i>=1; $i--) {
$y_val[] = $max_y * (($i * 2) / 10);
}
$max_height = 230;
$h_val = array();
$js_val = array();
$offset = 10; // 금액이 상대적으로 작아 높이가 0일 때 기본 높이로 사용
foreach($arr_order as $val) {
if($val['order'] > 0)
$h1 = intval(($max_height * $val['order']) / $max_y) + $offset;
else
$h1 = 0;
if($val['cancel'] > 0)
$h2 = intval(($max_height * $val['cancel']) / $max_y) + $offset;
else
$h2 = 0 ;
$h_val['order'][] = $h1;
$h_val['cancel'][] = $h2;
}
?>
처리할 주문
| 상태변경 |
건수 |
금액 |
| 주문 -> 입금 |
|
|
| 입금 -> 준비 |
|
|
| 준비 -> 배송 |
|
|
| 배송 -> 완료 |
|
|
재고현황
0);
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
}
?>
결제수단별 주문현황
| 구분 |
=0; $i--) {
$date = date("Y-m-d", strtotime('-'.$i.' days', G5_SERVER_TIME));
$info[$date] = get_order_settle_sum($date);
$day = substr($date, 5, 5).' ('.get_yoil($date).')';
$info_key[] = $date;
?>
|
| 건수 |
금액 |
|
|
|