get_cart_count 함수에 장바구니 보관기간 관련 코드 추가

This commit is contained in:
chicpro
2013-07-31 15:01:14 +09:00
parent c7e0a5a0c2
commit ee12e74641

View File

@ -338,11 +338,16 @@ class item_list
// 장바구니 건수 검사 // 장바구니 건수 검사
function get_cart_count($uq_id) function get_cart_count($uq_id)
{ {
global $g4; global $g4, $default;
$sql = " select count(ct_id) as cnt from {$g4['shop_cart_table']} where uq_id = '$uq_id' "; $sql = " select count(ct_id) as cnt from {$g4['shop_cart_table']} where uq_id = '$uq_id' ";
if($default['de_cart_keep_term']) {
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
$sql .= " and ct_time > '$ctime' ";
}
$row = sql_fetch($sql); $row = sql_fetch($sql);
return (int)$row['cnt']; $cnt = (int)$row['cnt'];
return $cnt;
} }