mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
기본 카운터 모듈의 관리자 통계 볼때 느린속도로 인하여 기본을 일별로 하고 일별/월별/년도별은 counter_status에서 추출하도록 코드 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3089 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cd36ff5718
commit
02ab3dca48
3 changed files with 33 additions and 15 deletions
|
|
@ -34,7 +34,10 @@
|
||||||
|
|
||||||
// 시간, 일, 월, 년도별로 데이터 가져오기
|
// 시간, 일, 월, 년도별로 데이터 가져오기
|
||||||
$type = Context::get('type');
|
$type = Context::get('type');
|
||||||
if(!$type) $type = 'hour';
|
if(!$type) {
|
||||||
|
$type = 'day';
|
||||||
|
Context::set('type',$type);
|
||||||
|
}
|
||||||
$detail_status = $oCounterModel->getHourlyStatus($type, $selected_date);
|
$detail_status = $oCounterModel->getHourlyStatus($type, $selected_date);
|
||||||
Context::set('detail_status', $detail_status);
|
Context::set('detail_status', $detail_status);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,9 @@
|
||||||
if(!$start_year) $start_year = date("Y");
|
if(!$start_year) $start_year = date("Y");
|
||||||
for($i=$start_year;$i<=date("Y");$i++) {
|
for($i=$start_year;$i<=date("Y");$i++) {
|
||||||
unset($args);
|
unset($args);
|
||||||
$args->regdate = sprintf('%04d', $i);
|
$args->start_date = sprintf('%04d0000', $i);
|
||||||
$output = executeQuery('counter.getCounterLog', $args);
|
$args->end_date = sprintf('%04d1231', $i);
|
||||||
|
$output = executeQuery('counter.getCounterLogStatus', $args);
|
||||||
$count = (int)$output->data->count;
|
$count = (int)$output->data->count;
|
||||||
$status->list[$i] = $count;
|
$status->list[$i] = $count;
|
||||||
if($count>$max) $max = $count;
|
if($count>$max) $max = $count;
|
||||||
|
|
@ -88,21 +89,19 @@
|
||||||
$year = substr($selected_date, 0, 4);
|
$year = substr($selected_date, 0, 4);
|
||||||
for($i=1;$i<=12;$i++) {
|
for($i=1;$i<=12;$i++) {
|
||||||
unset($args);
|
unset($args);
|
||||||
$args->regdate = sprintf('%04d%02d', $year, $i);
|
$args->start_date = sprintf('%04d%02d00', $year, $i);
|
||||||
$output = executeQuery('counter.getCounterLog', $args);
|
$args->end_date = sprintf('%04d%02d31', $year, $i);
|
||||||
|
$output = executeQuery('counter.getCounterLogStatus', $args);
|
||||||
$count = (int)$output->data->count;
|
$count = (int)$output->data->count;
|
||||||
$status->list[$i] = $count;
|
$status->list[$i] = (int)$count;
|
||||||
if($count>$max) $max = $count;
|
if($count>$max) $max = $count;
|
||||||
$sum += $count;
|
$sum += $count;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'day' :
|
case 'hour' :
|
||||||
$year = substr($selected_date, 0, 4);
|
for($i=0;$i<24;$i++) {
|
||||||
$month = substr($selected_date, 4, 2);
|
|
||||||
$end_day = date('t', mktime(0,0,0,$month,1,$year));
|
|
||||||
for($i=1;$i<=$end_day;$i++) {
|
|
||||||
unset($args);
|
unset($args);
|
||||||
$args->regdate = sprintf('%04d%02d%02d', $year, $month, $i);
|
$args->regdate = sprintf('%08d%02d', $selected_date, $i);
|
||||||
$output = executeQuery('counter.getCounterLog', $args);
|
$output = executeQuery('counter.getCounterLog', $args);
|
||||||
$count = (int)$output->data->count;
|
$count = (int)$output->data->count;
|
||||||
$status->list[$i] = $count;
|
$status->list[$i] = $count;
|
||||||
|
|
@ -111,10 +110,14 @@
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
for($i=0;$i<24;$i++) {
|
$year = substr($selected_date, 0, 4);
|
||||||
|
$month = substr($selected_date, 4, 2);
|
||||||
|
$end_day = date('t', mktime(0,0,0,$month,1,$year));
|
||||||
|
for($i=1;$i<=$end_day;$i++) {
|
||||||
unset($args);
|
unset($args);
|
||||||
$args->regdate = sprintf('%08d%02d', $selected_date, $i);
|
$args->start_date = sprintf('%04d%02d%02d', $year, $month, $i);
|
||||||
$output = executeQuery('counter.getCounterLog', $args);
|
$args->end_date = sprintf('%04d%02d%02d', $year, $month, $i);
|
||||||
|
$output = executeQuery('counter.getCounterLogStatus', $args);
|
||||||
$count = (int)$output->data->count;
|
$count = (int)$output->data->count;
|
||||||
$status->list[$i] = $count;
|
$status->list[$i] = $count;
|
||||||
if($count>$max) $max = $count;
|
if($count>$max) $max = $count;
|
||||||
|
|
|
||||||
12
modules/counter/queries/getCounterLogStatus.xml
Normal file
12
modules/counter/queries/getCounterLogStatus.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="getCounterLogStatus" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="counter_status" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="sum(unique_visitor)" alias="count"/>
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="more" column="regdate" var="start_date" notnull="notnull" pipe="and" />
|
||||||
|
<condition operation="less" column="regdate" var="end_date" notnull="notnull" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue