From b60bc5cc1c62ea6775928261608783352aab5913 Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 29 Jul 2013 09:40:48 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=9C=A0?= =?UTF-8?q?=ED=9A=A8=EA=B8=B0=EA=B0=84=20=EC=B6=94=EA=B0=80=20=EC=9E=91?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/point_list.php | 2 +- lib/common.lib.php | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/adm/point_list.php b/adm/point_list.php index 2c51cb399..cd3a27c8d 100644 --- a/adm/point_list.php +++ b/adm/point_list.php @@ -150,7 +150,7 @@ function point_clear() - + diff --git a/lib/common.lib.php b/lib/common.lib.php index 46c1582eb..3af0f16ee 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -882,7 +882,7 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r } // 포인트 건별 생성 - $po_expire_date = '0000-00-00'; + $po_expire_date = '9999-12-31'; if($config['cf_point_term'] > 0) { if($expire > 0) $po_expire_date = date('Y-m-d', strtotime('+'.($expire - 1).' days', G4_SERVER_TIME)); @@ -933,7 +933,12 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r // 사용포인트 입력 function insert_use_point($mb_id, $point, $po_id='') { - global $g4; + global $g4, $config; + + if($config['cf_point_term']) + $sql_order = " order by po_expire_date asc, po_id asc "; + else + $sql_order = " order by po_id asc "; $point1 = abs($point); $sql = " select po_id, po_point, po_use_point @@ -942,7 +947,7 @@ function insert_use_point($mb_id, $point, $po_id='') and po_id <> '$po_id' and po_expired = '0' and po_point > po_use_point - order by po_id asc "; + $sql_order "; $result = sql_query($sql); for($i=0; $row=sql_fetch_array($result); $i++) { $point2 = $row['po_point']; @@ -983,7 +988,7 @@ function get_point_sum($mb_id) set po_expired = '1' where mb_id = '$mb_id' and po_expired <> '1' - and po_expire_date <> '0000-00-00' + and po_expire_date <> '9999-12-31' and po_expire_date < '".G4_TIME_YMD."' "; sql_query($sql); } @@ -1013,7 +1018,7 @@ function get_expire_point($mb_id) from {$g4['point_table']} where mb_id = '$mb_id' and po_expired = '0' - and po_expire_date <> '0000-00-00' + and po_expire_date <> '9999-12-31' and po_expire_date < '".G4_TIME_YMD."' "; $row = sql_fetch($sql);