From 179fac494ea5f8466d0485b6380d5fbc1d792c1f Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 8 Nov 2013 15:40:32 +0900 Subject: [PATCH] =?UTF-8?q?#322=20=EC=82=AC=EC=9A=A9=ED=9B=84=EA=B8=B0=20?= =?UTF-8?q?=ED=8F=BC=EC=97=90=EC=84=9C=20=EC=9E=91=EC=84=B1=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=B2=B4=ED=81=AC=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/shop.lib.php | 24 ++++++++++++++++++++++++ mobile/shop/itemuseform.php | 3 +++ shop/itemuseform.php | 3 +++ shop/itemuseformupdate.php | 3 +++ 4 files changed, 33 insertions(+) diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 5a1e73d23..c38ae7151 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -1771,6 +1771,30 @@ function is_used_coupon($mb_id, $cp_id) return $used; } +// 상품후기 작성가능한지 체크 +function check_itemuse_write($close=true) +{ + global $g5, $default, $is_admin; + + if(!$is_admin && $default['de_item_use_write']) + { + $sql = " select count(*) as cnt + from {$g5['g5_shop_cart_table']} + where it_id = '$it_id' + and mb_id = '{$member['mb_id']}' + and ct_status = '완료' "; + $row = sql_fetch($sql); + + if($row['cnt'] == 0) + { + if($close) + alert_close('사용후기는 주문하신 상품의 상태가 완료인 경우에만 작성하실 수 있습니다.'); + else + alert('사용후기는 주문하신 상품의 상태가 완료인 경우에만 작성하실 수 있습니다.'); + } + } +} + //------------------------------------------------------------------------------ // 주문포인트를 적립한다. diff --git a/mobile/shop/itemuseform.php b/mobile/shop/itemuseform.php index 50a316843..44b6baabf 100644 --- a/mobile/shop/itemuseform.php +++ b/mobile/shop/itemuseform.php @@ -10,6 +10,9 @@ $w = escape_trim($_REQUEST['w']); $it_id = escape_trim($_REQUEST['it_id']); $is_id = escape_trim($_REQUEST['is_id']); +// 사용후기 작성 설정에 따른 체크 +check_itemuse_write(); + if ($w == "") { $is_score = 10; } else if ($w == "u") { diff --git a/shop/itemuseform.php b/shop/itemuseform.php index 3bed49711..42f0ae9da 100644 --- a/shop/itemuseform.php +++ b/shop/itemuseform.php @@ -16,6 +16,9 @@ $w = escape_trim($_REQUEST['w']); $it_id = escape_trim($_REQUEST['it_id']); $is_id = escape_trim($_REQUEST['is_id']); +// 사용후기 작성 설정에 따른 체크 +check_itemuse_write(); + if ($w == "") { $is_score = 10; } else if ($w == "u") { diff --git a/shop/itemuseformupdate.php b/shop/itemuseformupdate.php index 18f048f5e..61d9af8fb 100644 --- a/shop/itemuseformupdate.php +++ b/shop/itemuseformupdate.php @@ -5,6 +5,9 @@ if (!$is_member) { alert_close("사용후기는 회원만 작성이 가능합니다."); } +// 사용후기 작성 설정에 따른 체크 +check_itemuse_write(); + $is_subject = trim($_REQUEST['is_subject']); $is_content = trim($_REQUEST['is_content']);