mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1213 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
713bbfe3d2
commit
7ae6882c5c
16 changed files with 109 additions and 254 deletions
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
$oCounterController = &getController('counter');
|
||||
|
||||
// 00000000000000 일자로 기록될 전체 방문 기록 row 추가
|
||||
$oCounterController->insertTodayStatus('00000000000000');
|
||||
// 00000000 일자로 기록될 전체 방문 기록 row 추가
|
||||
$oCounterController->insertTodayStatus('000000');
|
||||
|
||||
// 오늘자 row입력
|
||||
$oCounterController->insertTodayStatus();
|
||||
|
|
|
|||
|
|
@ -54,16 +54,18 @@
|
|||
* @brief unique visitor 등록
|
||||
**/
|
||||
function insertUniqueVisitor() {
|
||||
$args->regdate = date("Ymd000000");
|
||||
return executeQuery('counter.updateCounterUnique', $args);
|
||||
$args->regdate = date("Ymd");
|
||||
executeQuery('counter.updateCounterUnique', $args);
|
||||
executeQuery('counter.updateTotalCounterUnique');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief pageview 등록
|
||||
**/
|
||||
function insertPageView() {
|
||||
$args->regdate = date("Ymd000000");
|
||||
return executeQuery('counter.updateCounterPageview', $args);
|
||||
$args->regdate = date("Ymd");
|
||||
executeQuery('counter.updateCounterPageview', $args);
|
||||
executeQuery('counter.updateTotalCounterPageview');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +73,7 @@
|
|||
**/
|
||||
function insertTodayStatus($regdate = 0) {
|
||||
if($regdate) $args->regdate = $regdate;
|
||||
else $args->regdate = date("Ymd000000");
|
||||
else $args->regdate = date("Ymd");
|
||||
executeQuery('counter.insertTodayStatus', $args);
|
||||
|
||||
// 로그 등록
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
* @brief 오늘자 카운터 현황 row 있는지 체크
|
||||
**/
|
||||
function isInsertedTodayStatus() {
|
||||
$args->regdate = date("Ymd000000");
|
||||
$args->regdate = date("Ymd");
|
||||
$output = executeQuery('counter.getTodayStatus', $args);
|
||||
return $output->data->count?true:false;
|
||||
}
|
||||
|
|
@ -38,18 +38,26 @@
|
|||
// 여러개의 날자 로그를 가져올 경우
|
||||
if(is_array($regdate)) {
|
||||
$date_count = count($regdate);
|
||||
for($i=0;$i<$date_count;$i++) {
|
||||
if(strlen($regdate[$i])==8) $regdate[$i] = $regdate[$i].'000000';
|
||||
$args->regdate = "'".implode("','",$regdate)."'";
|
||||
}
|
||||
$args->regdate = implode(',',$regdate);
|
||||
|
||||
// 단일 날자의 로그를 가져올 경우
|
||||
} else {
|
||||
if(strlen($regdate)==8) $regdate = $regdate.'000000';
|
||||
if(strlen($regdate)==8) $regdate = $regdate;
|
||||
$args->regdate = $regdate;
|
||||
}
|
||||
|
||||
$output = executeQuery('counter.getCounterStatus', $args);
|
||||
return $output->data;
|
||||
$status = $output->data;
|
||||
|
||||
if(!is_array($regdate)) return $status;
|
||||
|
||||
if(!is_array($status)) $status = array($status);
|
||||
unset($output);
|
||||
|
||||
foreach($status as $key => $val) {
|
||||
$output[substr($val->regdate,0,8)] = $val;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
<column name="pageview" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="regdate" notnull="notnull" default="00000000000000" />
|
||||
<condition operation="equal" column="regdate" var="regdate" notnull="notnull" pipe="or" />
|
||||
<condition operation="equal" column="regdate" var="regdate" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
<column name="pageview" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="regdate" notnull="notnull" default="00000000000000" />
|
||||
<condition operation="equal" column="regdate" var="regdate" notnull="notnull" pipe="or" />
|
||||
<condition operation="equal" column="regdate" var="regdate" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
11
modules/counter/queries/updateTotalCounterPageview.xml
Normal file
11
modules/counter/queries/updateTotalCounterPageview.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updateTotalCounterPageview" action="update">
|
||||
<tables>
|
||||
<table name="counter_status" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="pageview" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="regdate" default="00000000" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/counter/queries/updateTotalCounterUnique.xml
Normal file
12
modules/counter/queries/updateTotalCounterUnique.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="updateTotalCounterUnique" action="update">
|
||||
<tables>
|
||||
<table name="counter_status" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="unique_visitor" default="plus(1)" />
|
||||
<column name="pageview" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="regdate" default="00000000" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<table name="counter_status">
|
||||
<column name="regdate" type="date" primary_key="primary_key" />
|
||||
<column name="regdate" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="unique_visitor" type="number" size="11" default="0" />
|
||||
<column name="pageview" type="number" size="11" default="0" />
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue