쇼핑몰 엑셀 출력 부분에서 본인것만 엑셀로 뽑으려합니다.

쇼핑몰 엑셀 출력 부분에서 본인것만 엑셀로 뽑으려합니다.

QA

쇼핑몰 엑셀 출력 부분에서 본인것만 엑셀로 뽑으려합니다.

답변 3

본문

엑셀 출력 부분에서 로그인한 해당 본인 주문내역만 뽑으려합니다.

엑셀이 아닌 일반창은 아래 소스로 하니 본인것만 나오는데 아래 엑셀부분은 어떻게 수정해줘여할지요?

////////////////////////// 일반창부분

$sql = " select *
               from {$g5['g5_shop_order_table']}
              where mb_id = '{$member['mb_id']}'
              order by od_id desc
              $limit ";
    $result = sql_query($sql);  
 }  

//////////////////////////////////////////

 

 

////////////////////// 엑셀 부분

$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_cart_price, 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 ";
    $result = sql_query($sql);
    $cnt = _num_rows($result);
    if (!$cnt)
        alert("출력할 내역이 없습니다.");

이 질문에 댓글 쓰기 :

답변 3

$sql = " SELECT a.od_id, a.mb_id  <<<< 추가해 주세요

~~~~~~

$sql .= " and a.mb_id = ".$member['mb_id'];

   if ($ct_status)
        $sql .= " and b.ct_status = '$ct_status' ";

 

다음에 한줄 엔터 하셔서

        $sql .= " and a.mb_id = ".$member['mb_id'];

 

추가 하시면 될것같은데요

일반회원이 엑셀를 출력하게 하신건가요?
영카트에는 회원이 엑셀출력이 없는 걸로 아는데요?
관리자라면 내용을 자세히 알려주셔야 가능할듯 합니다.

where a.mb_id = '{$member['mb_id']}'  
     and 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' ";

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로