상품출력 순서 그리고 랜덤

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
상품출력 순서 그리고 랜덤

QA

상품출력 순서 그리고 랜덤

본문

상품을 출력할때 순서가 있다면 순서대로 출력을 하고 순서사 없다면 랜덤으로 출력하려면 어떻게 해야 하나요?

 

코드 [

 

  $list->set_type(6);

        $list->set_where(' (b.mb_id="' . $home_farm_id . '") ');

        //출력순서 변경

        $list->set_order_by(' it_order ');

 

        $list->set_view('it_img', true);

        $list->set_view('it_id', false);

        $list->set_view('it_name', true);

        $list->set_view('it_basic', true);

        $list->set_view('it_cust_price', true);

        $list->set_view('it_price', true);

        $list->set_view('it_icon', true);

        $list->set_view('sns', false);

        $list->set_view('star', false);

        $list->set_css('slides');

        echo $list->run();

 

]

이 질문에 댓글 쓰기 :

답변 1

shop/list.php


    // 상품 출력순서가 있다면
    if ($sort != "")
        $order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
    else
        $order_by = 'it_order, it_id desc';

다음 처럼 변경해 보세요.

    else
        $order_by = ' rand() ';

답변을 작성하시기 전에 로그인 해주세요.
전체 74
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT