날짜제한 문의
본문
아미나 파트너 몰 이용중인데
파트너 상품 등록을 아래소스는 일일 제한으로 두고있는데
10년으로 제한두고자 합니다
아래부분을 어케 수정할까요? 체크된 부분을 수정해야될것같은데 ..알려주시면 감사하겠습니다.
// 등록제한 체크 - 가장 작은 등록제한설정을 가져옴
$row = sql_fetch("select ca_id, ca_name, pt_limit from {$g5['g5_shop_category_table']} where pt_limit > 0 $upoint_where order by pt_limit");
$uplimit = ($pt['pt_limit']) ? (int)$pt['pt_limit'] : $row['pt_limit'];
$uplimit_ca = $row['ca_id'];
$uplimit_name = $row['ca_name'];
if($uplimit) { // 제한값이 있으면...
$row = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']}
where pt_id = '{$member['mb_id']}' and date_format(it_time, '%Y-%c-%d') = '".G5_TIME_YMD."' and (ca_id = '{$uplimit_ca}' or ca_id2 = '{$uplimit_ca}' or ca_id3 = '{$uplimit_ca}') ");
if($row['cnt'] && $row['cnt'] >= $uplimit) {
alert("최대 3개까지만 판매등록 가능합니다.\\n추가로 등록하시길 원하시다면 결제 후 진행해주시길 바랍니다.","/shop/item.php?it_id=1541483098");
}
}
답변 2
where pt_id = '{$member['mb_id']}' and date_format(it_time, '%Y-%c-%d') >= '".date("Y-m-d",strtotime("-10 YEAR"))."' and (ca_id = '{$uplimit_ca}' or ca_id2 = '{$uplimit_ca}' or ca_id3 = '{$uplimit_ca}') ");
이렇게 하면 최근 10년내로 됩니다.