* adjust code format.

* add latest3days period param.
This commit is contained in:
wangchunsheng
2012-08-28 01:07:41 +00:00
parent 6c6abc6590
commit 2bd72c839c
+4 -1
View File
@@ -477,7 +477,7 @@ class actionModel extends model
/**
* Compute the begin date and end date of a period.
*
* @param string $period
* @param string $period all|today|yesterday|twodaysago|latest2days|thisweek|lastweek|thismonth|lastmonth
* @access public
* @return array
*/
@@ -490,10 +490,13 @@ class actionModel extends model
$yesterday = $this->todo->yesterday();
$twoDaysAgo = $this->todo->twoDaysAgo();
$period = strtolower($period);
if($period == 'all') return array('begin' => '1970-1-1', 'end' => '2109-1-1');
if($period == 'today') return array('begin' => $today, 'end' => $tomorrow);
if($period == 'yesterday') return array('begin' => $yesterday, 'end' => $today);
if($period == 'twodaysago') return array('begin' => $twoDaysAgo, 'end' => $yesterday);
if($period == 'latest3days')return array('begin' => $twoDaysAgo, 'end' => $tomorrow);
/* If the period is by week, add the end time to the end date. */
if($period == 'thisweek' or $period == 'lastweek')