mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +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()
|
||||
{
|
||||
$date = date('Ymd');
|
||||
$output = $this->getHourlyStatus('week', $date);
|
||||
//for last week
|
||||
$date1 = date('Ymd', strtotime('-1 week'));
|
||||
$output1 = $this->getHourlyStatus('week', $date1);
|
||||
|
||||
$tmp = array();
|
||||
foreach($output->list AS $key=>$value)
|
||||
foreach($output1->list AS $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()
|
||||
{
|
||||
$date = date('Ymd');
|
||||
$output = $this->getHourlyStatus('week', $date, 0, true);
|
||||
//for last week
|
||||
$date1 = date('Ymd', strtotime('-1 week'));
|
||||
$output1 = $this->getHourlyStatus('week', $date1, 0, true);
|
||||
|
||||
$tmp = array();
|
||||
foreach($output->list AS $key=>$value)
|
||||
foreach($output1->list AS $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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue