本文整理汇总了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;
}