diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 5e5e7e280..ae935adcf 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -1873,7 +1873,7 @@ function is_soldout($it_id) } // 상품후기 작성가능한지 체크 -function check_itemuse_write($close=true) +function check_itemuse_write($it_id, $mb_id, $close=true) { global $g5, $default, $is_admin; @@ -1882,7 +1882,7 @@ function check_itemuse_write($close=true) $sql = " select count(*) as cnt from {$g5['g5_shop_cart_table']} where it_id = '$it_id' - and mb_id = '{$member['mb_id']}' + and mb_id = '$mb_id' and ct_status = '완료' "; $row = sql_fetch($sql); diff --git a/mobile/shop/itemuseform.php b/mobile/shop/itemuseform.php index 5a77f01c5..88f88c0be 100644 --- a/mobile/shop/itemuseform.php +++ b/mobile/shop/itemuseform.php @@ -10,11 +10,11 @@ $w = trim($_REQUEST['w']); $it_id = trim($_REQUEST['it_id']); $is_id = trim($_REQUEST['is_id']); -// 사용후기 작성 설정에 따른 체크 -check_itemuse_write(); - if ($w == "") { $is_score = 5; + + // 사용후기 작성 설정에 따른 체크 + check_itemuse_write($it_id, $member['mb_id']); } else if ($w == "u") { $use = sql_fetch(" select * from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' "); if (!$use) { diff --git a/shop/itemuseform.php b/shop/itemuseform.php index d47f7b0d0..ad2366603 100644 --- a/shop/itemuseform.php +++ b/shop/itemuseform.php @@ -16,11 +16,11 @@ $w = trim($_REQUEST['w']); $it_id = trim($_REQUEST['it_id']); $is_id = trim($_REQUEST['is_id']); -// 사용후기 작성 설정에 따른 체크 -check_itemuse_write(); - if ($w == "") { $is_score = 5; + + // 사용후기 작성 설정에 따른 체크 + check_itemuse_write($it_id, $member['mb_id']); } else if ($w == "u") { $use = sql_fetch(" select * from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' "); if (!$use) { diff --git a/shop/itemuseformupdate.php b/shop/itemuseformupdate.php index 0686fe4d1..642330d2a 100644 --- a/shop/itemuseformupdate.php +++ b/shop/itemuseformupdate.php @@ -5,9 +5,6 @@ if (!$is_member) { alert_close("사용후기는 회원만 작성이 가능합니다."); } -// 사용후기 작성 설정에 따른 체크 -check_itemuse_write(); - $it_id = trim($_REQUEST['it_id']); $is_subject = trim($_POST['is_subject']); $is_content = trim($_POST['is_content']); @@ -15,6 +12,9 @@ $is_name = trim($_POST['is_name']); $is_password = trim($_POST['is_password']); $is_score = (int)$_POST['is_score'] > 5 ? 0 : (int)$_POST['is_score']; +// 사용후기 작성 설정에 따른 체크 +check_itemuse_write($it_id, $member['mb_id']); + if ($w == "" || $w == "u") { $is_name = $member['mb_name']; $is_password = $member['mb_password'];