(10원짜리)주문내역엑셀 출력시 한줄로
관리자에서 주문내역 출력시 한사람이 여러개 상품 주문시 갯수만큼 줄이 생기는데,
상품을 콤마로 구분하여 한줄로 출력하는 방법입니다.
adm/shop_admin/orderpintresult.php 에
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
if ($ct_status)
$sql .= " and b.ct_status = '$ct_status' ";
$sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id ";
아래와 같이 od_id 값으로 group by b.od_id / 상품은 group_concat(b.it_name , b.ct_qty) as it_name
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, group_concat(b.it_name , b.ct_qty) as it_name , b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
if ($ct_status)
$sql .= " and b.ct_status = '$ct_status' group by b.od_id";
$sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id ";
상품을 콤마로 구분하여 한줄로 출력하는 방법입니다.
adm/shop_admin/orderpintresult.php 에
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
if ($ct_status)
$sql .= " and b.ct_status = '$ct_status' ";
$sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id ";
아래와 같이 od_id 값으로 group by b.od_id / 상품은 group_concat(b.it_name , b.ct_qty) as it_name
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, group_concat(b.it_name , b.ct_qty) as it_name , b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
where a.od_id = b.od_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
if ($ct_status)
$sql .= " and b.ct_status = '$ct_status' group by b.od_id";
$sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id ";
댓글 6개
5년 전
감사합니다
브러운아이
5년 전
유용한 정보 감사합니다.
5년 전
감사합니다
4년 전
감사합니다.
4년 전
운송장 출력시 필요한기능 꿀팁 감사합니다.~^^
Bsori
4년 전
감사합니다.
게시판 목록
영카트5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 341 | 4년 전 | 4073 | ||
| 340 | 4년 전 | 3379 | ||
| 339 | 4년 전 | 3210 | ||
| 338 | 4년 전 | 3772 | ||
| 337 | 4년 전 | 4131 | ||
| 336 | 4년 전 | 2811 | ||
| 335 |
|
4년 전 | 2700 | |
| 334 | 4년 전 | 2254 | ||
| 333 |
|
4년 전 | 2316 | |
| 332 |
|
4년 전 | 3154 | |
| 331 |
|
4년 전 | 3799 | |
| 330 | 4년 전 | 2210 | ||
| 329 | 4년 전 | 3703 | ||
| 328 | 4년 전 | 2168 | ||
| 327 | 4년 전 | 2730 | ||
| 326 | 4년 전 | 2590 | ||
| 325 | 4년 전 | 5033 | ||
| 324 | 4년 전 | 2198 | ||
| 323 |
파이브스톤즈
|
5년 전 | 3025 | |
| 322 | 5년 전 | 2525 | ||
| 321 | 5년 전 | 2557 | ||
| 320 | 5년 전 | 1889 | ||
| 319 | 5년 전 | 2569 | ||
| 318 | 5년 전 | 4110 | ||
| 317 | 5년 전 | 4109 | ||
| 316 | 5년 전 | 2654 | ||
| 315 | 5년 전 | 3835 | ||
| 314 | 5년 전 | 3647 | ||
| 313 |
|
5년 전 | 1647 | |
| 312 | 5년 전 | 4155 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기