0 "; break; default: $where[] = " od_status = '$od_status' "; break; } switch ($od_status) { case '주문' : $sort1 = "od_id"; $sort2 = "desc"; break; case '입금' : // 결제완료 $sort1 = "od_receipt_time"; $sort2 = "desc"; break; case '배송' : // 배송중 $sort1 = "od_invoice_time"; $sort2 = "desc"; break; } } if ($od_settle_case) { if( $od_settle_case === '간편결제' ) { $where[] = " od_settle_case in ('간편결제', '삼성페이', 'lpay', 'inicis_kakaopay') "; } else { $where[] = " od_settle_case = '$od_settle_case' "; } } if ($od_misu) { $where[] = " od_misu != 0 "; } if ($od_cancel_price) { $where[] = " od_cancel_price != 0 "; } if ($od_refund_price) { $where[] = " od_refund_price != 0 "; } if ($od_receipt_point) { $where[] = " od_receipt_point != 0 "; } if ($od_coupon) { $where[] = " ( od_cart_coupon > 0 or od_coupon > 0 or od_send_coupon > 0 ) "; } if ($od_escrow) { $where[] = " od_escrow = 1 "; } if ($fr_date && $to_date) { $where[] = " od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' "; } if ($where) { $sql_search = ' where '.implode(' and ', $where); } if ($sel_field == "") $sel_field = "od_id"; if ($sort1 == "") $sort1 = "od_id"; if ($sort2 == "") $sort2 = "desc"; $sql_common = " from {$g5['g5_shop_order_table']} $sql_search "; $sql = " select count(od_id) as cnt " . $sql_common; $row = sql_fetch($sql); $total_count = $row['cnt']; $rows = $config['cf_page_rows']; $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 $sql = " select *, (od_cart_coupon + od_coupon + od_send_coupon) as couponprice $sql_common order by $sort1 $sort2 limit $from_record, $rows "; $result = sql_query($sql); $qstr1 = "od_status=".urlencode($od_status)."&od_settle_case=".urlencode($od_settle_case)."&od_misu=$od_misu&od_cancel_price=$od_cancel_price&od_refund_price=$od_refund_price&od_receipt_point=$od_receipt_point&od_coupon=$od_coupon&fr_date=$fr_date&to_date=$to_date&sel_field=$sel_field&search=$search&save_search=$search"; if($default['de_escrow_use']) $qstr1 .= "&od_escrow=$od_escrow"; $qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; $listall = '전체목록'; // 주문삭제 히스토리 테이블 필드 추가 if(!sql_query(" select mb_id from {$g5['g5_shop_order_delete_table']} limit 1 ", false)) { sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}` ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`, ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`, ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true); } if( function_exists('pg_setting_check') ){ pg_setting_check(true); } ?>