mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-12 05:22:35 +09:00
issue 2740 add last week statistics
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12470 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9e46f8687e
commit
d19ad9c2d0
1 changed files with 36 additions and 10 deletions
|
|
@ -287,32 +287,58 @@ class counterModel extends counter
|
||||||
|
|
||||||
public function getWeeklyUniqueVisitor()
|
public function getWeeklyUniqueVisitor()
|
||||||
{
|
{
|
||||||
$date = date('Ymd');
|
//for last week
|
||||||
$output = $this->getHourlyStatus('week', $date);
|
$date1 = date('Ymd', strtotime('-1 week'));
|
||||||
|
$output1 = $this->getHourlyStatus('week', $date1);
|
||||||
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
foreach($output->list AS $key=>$value)
|
foreach($output1->list AS $key=>$value)
|
||||||
{
|
{
|
||||||
$tmp["'".$key."'"] = $value;
|
$tmp["'".$key."'"] = $value;
|
||||||
}
|
}
|
||||||
$output->list = $tmp;
|
$output1->list = $tmp;
|
||||||
|
|
||||||
$this->add('data', $output);
|
//for this week
|
||||||
|
$date2 = date('Ymd');
|
||||||
|
$output2 = $this->getHourlyStatus('week', $date2);
|
||||||
|
|
||||||
|
$tmp = array();
|
||||||
|
foreach($output2->list AS $key=>$value)
|
||||||
|
{
|
||||||
|
$tmp["'".$key."'"] = $value;
|
||||||
|
}
|
||||||
|
$output2->list = $tmp;
|
||||||
|
|
||||||
|
$this->add('last_week', $output1);
|
||||||
|
$this->add('this_week', $output2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWeeklyPageView()
|
public function getWeeklyPageView()
|
||||||
{
|
{
|
||||||
$date = date('Ymd');
|
//for last week
|
||||||
$output = $this->getHourlyStatus('week', $date, 0, true);
|
$date1 = date('Ymd', strtotime('-1 week'));
|
||||||
|
$output1 = $this->getHourlyStatus('week', $date1, 0, true);
|
||||||
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
foreach($output->list AS $key=>$value)
|
foreach($output1->list AS $key=>$value)
|
||||||
{
|
{
|
||||||
$tmp["'".$key."'"] = $value;
|
$tmp["'".$key."'"] = $value;
|
||||||
}
|
}
|
||||||
$output->list = $tmp;
|
$output1->list = $tmp;
|
||||||
|
|
||||||
$this->add('data', $output);
|
//for this week
|
||||||
|
$date2 = date('Ymd');
|
||||||
|
$output2 = $this->getHourlyStatus('week', $date2, 0, true);
|
||||||
|
|
||||||
|
$tmp = array();
|
||||||
|
foreach($output2->list AS $key=>$value)
|
||||||
|
{
|
||||||
|
$tmp["'".$key."'"] = $value;
|
||||||
|
}
|
||||||
|
$output2->list = $tmp;
|
||||||
|
|
||||||
|
$this->add('last_week', $output1);
|
||||||
|
$this->add('this_week', $output2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* End of file counter.model.php */
|
/* End of file counter.model.php */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue