포인트소계 계산 쿼리 추가

This commit is contained in:
chicpro
2012-12-14 17:00:30 +09:00
parent 849d5bc8c8
commit c7b87be8ce

View File

@ -20,6 +20,20 @@ $rows = $config[cf_page_rows];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산 $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함 $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'];
?> ?>
<h1>포인트내역</h1> <h1>포인트내역</h1>
@ -37,8 +51,8 @@ $from_record = ($page - 1) * $rows; // 시작 열을 구함
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">소계</td> <td colspan="2">소계</td>
<td><?=$sum_point1?></td> <td><?=number_format($sum_point1)?></td>
<td><?=$sum_point2?></td> <td><?=number_format($sum_point2)?></td>
</tr> </tr>
</tfoot> </tfoot>
<tbody> <tbody>