개별상품할인 쿠폰 적용된 상품만 출력하기

개별상품할인 쿠폰 적용된 상품만 출력하기

QA

개별상품할인 쿠폰 적용된 상품만 출력하기

본문

특정 페이지에 개별상품할인 쿠폰이 적용된 상품을 출력하고자 합니다.

 


$list_mod = 4;     // 가로 이미지수
$list_row = 1;     // 이미지줄 수, Query를 직접 지정하기 때문에 이미지줄 수는 적용되지 않음
$img_width = 230;  // 이미지 폭
$img_height = 230; // 이미지 높이
$skin = G5_SHOP_SKIN_PATH.'/main.10.skin.php'; // 스킨
$sql = " select * from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_coupon_table']} b where a.it_soldout = '0' and a.it_stock_qty > '0' and b.cp_method = '0' and b.cp_start <= '".G5_TIME_YMD."' and b.cp_end >= '".G5_TIME_YMD."' limit 20";
$list = new item_list($skin, $list_mod, $list_row, $img_width, $img_height);
$list->set_query($sql);
$list->set_view('it_img', true);
$list->set_view('it_id', true);
$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', true);
echo $list->run();

 

로 적용하면 상품정보를 제대로 가지고 오지 못하는데요, 뭐가 잘못되었을까요?

이 질문에 댓글 쓰기 :

답변 1

it_soldout, it_stock_qty, cp_method 다

DB의 항목의 값이 숫자여야 하네요.

 

it_soldout

tinyint(4)

 0 

상품품절

it_stock_qty

int(11)

 0

재고수량

 

where a.it_soldout = 0 and a.it_stock_qty > 0 and b.cp_method = 0 으로 수정해보세요. 

sql에서나 php등의 프로그램에서나 data의 type에 맞게 지정하고 사용해야 합니다.

문자는 따옴표로 묶어주지만 int, tiny 등 숫자타입은 따옴표 없이 숫자만 쓰면 됩니다.

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

회원로그인

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