orderinquiryview.php 정렬을 최신 날짜순으로 정열 하려는데요...

orderinquiryview.php 정렬을 최신 날짜순으로 정열 하려는데요...

QA

orderinquiryview.php 정렬을 최신 날짜순으로 정열 하려는데요...

답변 3

본문

현재 소스 코드에 보면 정렬이.... 날짜순으로 안되어 있어서..... 마지막 주문한 것이 맨 마지막 페이지에 보이니까  불편 해서요... 소스 어디를 수정 해야 할지....

 

몰라서 올립니다..

 

<div id="sod_fin">

    <div id="sod_fin_no">주문번호 <strong><?php echo $od_id; ?></strong></div>

    <section class="sod_fin_list">
        <h2>주문하신 상품</h2>

        <?php
        $st_count1 = $st_count2 = 0;
        $custom_cancel = false;

        $sql = " select it_id, it_name, cp_price, ct_send_cost, it_sc_type
                    from {$g5['g5_shop_cart_table']}
                    where od_id = '$od_id'
                    group by it_id
                    order by ct_id ";
        $result = sql_query($sql);
        ?>
        <ul id="sod_list_inq" class="sod_list">
            <?php
            for($i=0; $row=sql_fetch_array($result); $i++) {
                $image_width = 65;
                $image_height = 65;
                $image = get_it_image($row['it_id'], 65, 65, '', '', $row['it_name']);

                // 옵션항목
                $sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, io_type, io_price
                            from {$g5['g5_shop_cart_table']}
                            where od_id = '$od_id'
                              and it_id = '{$row['it_id']}'
                            order by io_type asc, ct_id asc ";
                $res = sql_query($sql);

                // 합계금액 계산
                $sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
                                SUM(ct_qty) as qty
                            from {$g5['g5_shop_cart_table']}
                            where it_id = '{$row['it_id']}'
                              and od_id = '$od_id' ";
                $sum = sql_fetch($sql);
 

이 질문에 댓글 쓰기 :

답변 3

해당 부분은 하나의 주문에 대한 상세 페이지라서 질문하신것처럼 정렬을 하려면 장바구니 제품 밖에 불가능 한데요


order by ct_id
이부분을 변경하시면 됩니다
 

근데 저건 장바구니 고유키 인지라  마지막 주문한것  의 의미를 잘 모르겠네요

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