本文整理匯總了PHP中DateTimeUtil::getStrTimeScope方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtil::getStrTimeScope方法的具體用法?PHP DateTimeUtil::getStrTimeScope怎麽用?PHP DateTimeUtil::getStrTimeScope使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DateTimeUtil
的用法示例。
在下文中一共展示了DateTimeUtil::getStrTimeScope方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCommonTimeScope
public static function getCommonTimeScope()
{
static $timeScope = array();
if (empty($timeScope)) {
$time = EnvUtil::getRequest("time");
$start = EnvUtil::getRequest("start");
$end = EnvUtil::getRequest("end");
if (!empty($time)) {
if (!in_array($time, array("thisweek", "lastweek", "thismonth", "lastmonth"))) {
$time = "thisweek";
}
} else {
if (!empty($start) && !empty($end)) {
$start = strtotime($start);
$end = strtotime($end);
if ($start && $end) {
$timeScope = array("timestr" => "custom", "start" => $start, "end" => $end);
}
} else {
$time = "thisweek";
}
}
if (empty($timeScope)) {
$timeScope = DateTimeUtil::getStrTimeScope($time);
$timeScope["timestr"] = $time;
}
}
return $timeScope;
}
示例2: getListFilterParam
protected function getListFilterParam()
{
static $params = array();
if (empty($params)) {
$type = EnvUtil::getRequest("type");
if (!in_array($type, array("all", "perform", "end"))) {
$type = "all";
}
$scope = EnvUtil::getRequest("scope");
if (!in_array($scope, array("none", "start", "handle", "manage", "focus", "custom"))) {
$scope = "none";
}
$params["beginuser"] = null;
if ($scope == "custom") {
$beginUser = EnvUtil::getRequest("beginuser");
if (!empty($beginUser)) {
$params["beginuser"] = $beginUser;
} else {
$scope = "none";
}
}
$time = EnvUtil::getRequest("time");
$timeScope = array("none", "today", "yesterday", "thisweek", "lastweek", "thismonth", "lastmonth", "custom");
if (!in_array($time, $timeScope)) {
$time = "none";
}
if ($time == "custom") {
$start = EnvUtil::getRequest("start") . "";
$end = EnvUtil::getRequest("end") . "";
$params["start"] = strtotime($start) !== false ? strtotime($start) : null;
$params["end"] = strtotime($end) !== false ? strtotime($end) : null;
} elseif ($time !== "none") {
$times = DateTimeUtil::getStrTimeScope($time);
$params["start"] = $times["start"];
$params["end"] = $times["end"];
} else {
$params["start"] = $params["end"] = null;
}
$params["flowid"] = intval(EnvUtil::getRequest("flowid"));
$params["type"] = $type;
$params["scope"] = $scope;
$params["time"] = $time;
}
return $params;
}