From 3c0d2da9413bf8b04f4a5434752e09657314d951 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 14 Dec 2012 17:36:39 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EC=86=8C?= =?UTF-8?q?=EA=B3=84=20=EC=BF=BC=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/point.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/bbs/point.php b/bbs/point.php index 99d4bc276..c732d7ffd 100644 --- a/bbs/point.php +++ b/bbs/point.php @@ -21,19 +21,20 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 -// 지급포인트소계 -$sql = " select SUM(po_point) as sum_point1 - $sql_common - and po_point >= 0 "; -$row = sql_fetch($sql); -$sum_point1 = $row['sum_point1']; - -// 사용포인트소계 -$sql = " select SUM(po_point) as sum_point2 - $sql_common - and po_point < 0 "; -$row = sql_fetch($sql); -$sum_point2 = $row['sum_point2']; +// 포인트소계 +$sql = " select po_point + {$sql_common} + {$sql_order} + limit {$from_record}, {$rows} "; +$result = sql_query($sql); +$sum_point1 = $sum_point2 = 0; +for($i=0; $row=sql_fetch_array($result); $i++) { + if($row['po_point'] >= 0) { + $sum_point1 += $row['po_point']; + } else { + $sum_point2 += $row['po_point']; + } +} ?>

포인트내역