mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
NOISSUE code rearrange counter.controller.php
This commit is contained in:
parent
12e9448758
commit
c413dc795e
1 changed files with 13 additions and 16 deletions
|
|
@ -46,27 +46,25 @@ class counterController extends counter
|
||||||
// Check the logs
|
// Check the logs
|
||||||
$oCounterModel = getModel('counter');
|
$oCounterModel = getModel('counter');
|
||||||
|
|
||||||
// Register today's row if not exist
|
if($oCounterModel->isInsertedTodayStatus($site_srl))
|
||||||
if(!$oCounterModel->isInsertedTodayStatus($site_srl))
|
|
||||||
{
|
{
|
||||||
$this->insertTodayStatus(0, $site_srl);
|
if($oCounterModel->isLogged($site_srl))
|
||||||
// check user if the previous row exists
|
{
|
||||||
|
// Register pageview
|
||||||
|
$this->insertPageView($site_srl);
|
||||||
}
|
}
|
||||||
else
|
else // If unregistered IP
|
||||||
{
|
|
||||||
// If unregistered IP
|
|
||||||
if(!$oCounterModel->isLogged($site_srl))
|
|
||||||
{
|
{
|
||||||
// Leave logs
|
// Leave logs
|
||||||
$this->insertLog($site_srl);
|
$this->insertLog($site_srl);
|
||||||
// Register unique and pageview
|
// Register unique and pageview
|
||||||
$this->insertUniqueVisitor($site_srl);
|
$this->insertUniqueVisitor($site_srl);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Register pageview
|
|
||||||
$this->insertPageView($site_srl);
|
|
||||||
}
|
}
|
||||||
|
else // Register today's row if not exist
|
||||||
|
{
|
||||||
|
$this->insertTodayStatus(0, $site_srl);
|
||||||
|
// check user if the previous row exists
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
@ -97,16 +95,15 @@ class counterController extends counter
|
||||||
function insertUniqueVisitor($site_srl = 0)
|
function insertUniqueVisitor($site_srl = 0)
|
||||||
{
|
{
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
|
$args->regdate = '0,' . date('Ymd');
|
||||||
|
|
||||||
if($site_srl)
|
if($site_srl)
|
||||||
{
|
{
|
||||||
$args->regdate = '0,' . date('Ymd');
|
|
||||||
$args->site_srl = $site_srl;
|
$args->site_srl = $site_srl;
|
||||||
$output = executeQuery('counter.updateSiteCounterUnique', $args);
|
$output = executeQuery('counter.updateSiteCounterUnique', $args);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$args->regdate = '0,' . date('Ymd');
|
|
||||||
$output = executeQuery('counter.updateCounterUnique', $args);
|
$output = executeQuery('counter.updateCounterUnique', $args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue