本文整理汇总了PHP中ConvertUtil::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP ConvertUtil::formatDate方法的具体用法?PHP ConvertUtil::formatDate怎么用?PHP ConvertUtil::formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConvertUtil
的用法示例。
在下文中一共展示了ConvertUtil::formatDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showDetail
protected function showDetail()
{
$repid = intval(EnvUtil::getRequest("repid"));
$isShowTitle = EnvUtil::getRequest("isShowTitle");
$fromController = EnvUtil::getRequest("fromController");
$report = Report::model()->fetchByPk($repid);
$uid = Ibos::app()->user->uid;
Report::model()->addReaderuid($report, $uid);
$record = ReportRecord::model()->fetchAllRecordByRep($report);
$attachs = array();
if (!empty($report["attachmentid"])) {
$attachs = AttachUtil::getAttach($report["attachmentid"], true, true, false, false, true);
}
$readers = array();
if (!empty($report["readeruid"])) {
$readerArr = explode(",", $report["readeruid"]);
$readers = User::model()->fetchAllByPk($readerArr);
}
$stampUrl = "";
if ($report["stamp"] != 0) {
$stamp = Stamp::model()->fetchStampById($report["stamp"]);
$stampUrl = FileUtil::fileName(Stamp::STAMP_PATH) . $stamp;
}
$report["addtime"] = ConvertUtil::formatDate($report["addtime"], "u");
$params = array("lang" => Ibos::getLangSource("report.default"), "repid" => $repid, "report" => $report, "uid" => $uid, "orgPlanList" => $record["orgPlanList"], "outSidePlanList" => $record["outSidePlanList"], "nextPlanList" => $record["nextPlanList"], "attachs" => $attachs, "readers" => $readers, "stampUrl" => $stampUrl, "fromController" => $fromController, "isShowTitle" => $isShowTitle, "allowComment" => $this->getIsAllowComment($fromController));
$detailAlias = "application.modules.report.views.detail";
$detailView = $this->renderPartial($detailAlias, $params, true);
$this->ajaxReturn(array("data" => $detailView, "isSuccess" => true));
}
示例2: handleList
protected function handleList($runProcess)
{
foreach ($runProcess as &$run) {
$run["user"] = User::model()->fetchByUid($run["beginuser"]);
$run["begintime"] = ConvertUtil::formatDate($run["begintime"], "u");
$param = array("runid" => $run["runid"], "flowid" => $run["flowid"]);
$run["key"] = WfCommonUtil::param($param);
}
return array("list" => $runProcess);
}
示例3: fetchAllByDocid
public function fetchAllByDocid($docid)
{
$versionData = $this->fetchAll("docid=:docid ORDER BY version DESC", array(":docid" => $docid));
if (!empty($versionData)) {
$users = Yii::app()->setting->get("cache/users");
foreach ($versionData as $key => $version) {
$versionData[$key]["uptime"] = ConvertUtil::formatDate($version["uptime"], "u");
$versionData[$key]["editor"] = isset($users[$version["editor"]]) ? $users[$version["editor"]]["realname"] : "--";
$versionData[$key]["showVersion"] = OfficialdocUtil::changeVersion($version["version"]);
}
}
return $versionData;
}
示例4: fetchUserList
public function fetchUserList($feedId, $nums, $offset = 0, $order = "ctime DESC")
{
$criteria = array("select" => "uid,ctime", "condition" => sprintf("feedid = %d", $feedId), "order" => $order, "offset" => $offset, "limit" => $nums);
$result = $this->fetchAll($criteria);
if ($result) {
foreach ($result as &$res) {
$res["user"] = User::model()->fetchByUid($res["uid"]);
$res["diggtime"] = ConvertUtil::formatDate($res["ctime"]);
}
} else {
$result = array();
}
return $result;
}
示例5: processShareListData
public static function processShareListData($uid, $data)
{
$result = array();
$attentions = DiaryAttention::model()->fetchAllByAttributes(array("uid" => $uid));
$auidArr = ConvertUtil::getSubByKey($attentions, "auid");
foreach ($data as $diary) {
$diary["content"] = StringUtil::cutStr(strip_tags($diary["content"]), 255);
$diary["realname"] = User::model()->fetchRealnameByUid($diary["uid"]);
$diary["addtime"] = ConvertUtil::formatDate($diary["addtime"], "u");
$isattention = in_array($diary["uid"], $auidArr);
$diary["isattention"] = $isattention ? 1 : 0;
$diary["user"] = User::model()->fetchByUid($diary["uid"]);
$result[] = $diary;
}
return $result;
}
示例6: handelListData
public static function handelListData($reports)
{
$return = array();
foreach ($reports as $report) {
$report["cutSubject"] = StringUtil::cutStr(strip_tags($report["subject"]), 60);
$report["user"] = User::model()->fetchByUid($report["uid"]);
$readeruid = $report["readeruid"];
$report["readercount"] = empty($readeruid) ? 0 : count(explode(",", trim($readeruid, ",")));
$report["content"] = StringUtil::cutStr(strip_tags($report["content"]), 255);
$report["addtime"] = ConvertUtil::formatDate($report["addtime"], "u");
if ($report["stamp"] != 0) {
$path = Stamp::model()->fetchIconById($report["stamp"]);
$report["stampPath"] = FileUtil::fileName(Stamp::STAMP_PATH . $path);
}
$return[] = $report;
}
return $return;
}
示例7: getListData
public static function getListData($datas, $uid)
{
$listDatas = array();
$checkTime = 3 * 86400;
$readArtIds = ArticleReader::model()->fetchReadArtIdsByUid($uid);
foreach ($datas as $data) {
$data["subject"] = StringUtil::cutStr($data["subject"], 50);
$data["readStatus"] = in_array($data["articleid"], $readArtIds) ? 1 : -1;
if ($data["readStatus"] === -1 && TIMESTAMP - $checkTime < $data["uptime"]) {
$data["readStatus"] = 2;
}
$data["author"] = User::model()->fetchRealnameByUid($data["author"]);
if (empty($data["uptime"])) {
$data["uptime"] = $data["addtime"];
}
$data["uptime"] = ConvertUtil::formatDate($data["uptime"], "u");
$keyword = EnvUtil::getRequest("keyword");
if (!empty($keyword)) {
$data["subject"] = preg_replace("|({$keyword})|i", "<span style='color:red'>\$1</span>", $data["subject"]);
}
if ($data["ishighlight"] == "1") {
$highLightStyle = $data["highlightstyle"];
$hiddenInput = "<input type='hidden' id='{$data["articleid"]}_hlstyle' value='{$highLightStyle}'/>";
$data["subject"] .= $hiddenInput;
$highLightStyleArr = explode(",", $highLightStyle);
$color = $highLightStyleArr[1];
$isB = $highLightStyleArr[0];
$isI = $highLightStyleArr[2];
$isU = $highLightStyleArr[3];
$isB && ($data["subject"] = "<b>{$data["subject"]}</b>");
$isU && ($data["subject"] = "<u>{$data["subject"]}</u>");
$fontStyle = "";
$color != "" && ($fontStyle .= "color:{$color};");
$isI && ($fontStyle .= "font-style:italic;");
$fontStyle != "" && ($data["subject"] = "<font style='{$fontStyle}'>{$data["subject"]}</font>");
}
$listDatas[] = $data;
}
return $listDatas;
}
示例8:
" width="60" height="60">
</a>
</div>
<div class="cmt-body">
<p class="mbs xcm">
<strong class="xcn"><?php
echo $user_info['realname'];
?>
:</strong>
<?php
echo $body;
?>
</p>
<div class="mbs fss">
<span><?php
echo ConvertUtil::formatDate($ctime, 'u');
?>
</span>
<a href="javascript:;" data-act="getreply" data-param="name=<?php
echo $user_info['realname'];
?>
&module=message&table=feed&rowid=<?php
echo $feedid;
?>
" class="pull-right"><?php
echo $lang['Reply'];
?>
</a>
</div>
<div class="well well-small well-lightblue" style="display: none;">
<textarea class="mbs"><?php
示例9: getViewFlowData
public static function getViewFlowData($runId, $flowId, $uid, &$remindUid)
{
$fl = array();
$flow = new ICFlowType(intval($flowId));
$pMaxId = FlowRunProcess::model()->fetchMaxIDByRunID($runId);
$process = WfCommonUtil::loadProcessCache($flowId);
for ($processId = 1; $processId <= $pMaxId; $processId++) {
foreach (FlowRunProcess::model()->fetchAllProcessByProcessID($runId, $processId) as $rp) {
$temp = array("flowprocess" => $rp["flowprocess"], "parent" => $rp["parent"], "runid" => $rp["runid"], "processid" => $rp["processid"]);
if (FlowRunProcess::model()->getIsAgent($runId, $processId, $uid, $rp["flowprocess"])) {
$temp["isprocuser"] = 1;
} else {
$temp["isprocuser"] = 0;
}
$op = FlowRunProcess::model()->fetchOpUserByUniqueID($runId, $processId, $rp["flowprocess"]);
if (!empty($op)) {
$temp["opuser"] = !empty($op["uid"]) ? User::model()->fetchRealnameByUid($op["uid"]) : "";
$temp["opprocessflag"] = $op["flag"];
} else {
$temp["opuser"] = User::model()->fetchRealnameByUid($rp["uid"]);
$temp["opprocessflag"] = $rp["flag"];
}
if ($flow->isFixed()) {
if (isset($process[$rp["flowprocess"]])) {
$temp["name"] = $process[$rp["flowprocess"]]["name"];
$temp["timeout"] = $process[$rp["flowprocess"]]["timeout"];
$temp["signlook"] = $process[$rp["flowprocess"]]["signlook"];
} else {
$temp["name"] = Ibos::lang("Process steps already deleted", "workflow.default");
}
} else {
$temp["timeout"] = 0;
}
foreach (FlowRunProcess::model()->fetchAllProcessByFlowProcess($runId, $processId, $rp["flowprocess"]) as $arp) {
$temp["prcsuid"] = $arp["uid"];
$temp["opflag"] = $arp["opflag"];
$temp["flag"] = $arp["flag"];
$temp["processtime"] = ConvertUtil::formatDate($arp["processtime"], "u");
$temp["delivertime"] = $arp["delivertime"] != 0 ? ConvertUtil::formatDate($arp["delivertime"], "u") : $arp["delivertime"];
if ($arp["flag"] == "1") {
$temp["timeused"] = 0;
} elseif ($arp["flag"] == "2") {
$temp["timeused"] = TIMESTAMP - $arp["processtime"];
} elseif ($arp["delivertime"] == 0) {
$temp["timeused"] = 0;
} else {
$temp["timeused"] = $arp["delivertime"] - $arp["processtime"];
}
if ($arp["processtime"] == "") {
$temp["timeused"] = 0;
}
$temp["timestr"] = WfCommonUtil::getTime($temp["timeused"]);
$temp["timeoutflag"] = 0;
if ($arp["flag"] == "2" && $arp["processtime"] != "" && $temp["timeout"] != 0) {
if ($temp["timeout"] * 3600 < $temp["timeused"]) {
$temp["timeoutflag"] = 1;
$temp["timeused"] = WfCommonUtil::getTime($temp["timeused"] - $temp["timeout"] * 3600);
}
}
if ($arp["flag"] == 1 || $temp["timeoutflag"] == 1) {
$remindUid[] = $arp["uid"];
}
$temp["redo"] = false;
if ($temp["opuser"] == $uid && $arp["uid"] != $uid && ($temp["opprocessflag"] == 1 || $temp["opprocessflag"] == 2) && ($arp["flag"] == 3 || $arp["flag"] == 4)) {
$temp["redo"] = true;
}
$temp["log"] = FlowRunLog::model()->fetchLog($temp["runid"], $temp["processid"], $temp["flowprocess"], 8);
}
$fl[count($fl) + 1] = $temp;
}
}
return $fl;
}
示例10:
</strong><?php
} else {
?>
<span class="<?php
echo $importantClass;
?>
"><?php
echo $data['subject'];
?>
</span><?php
}
?>
</a>
</td>
<td width="120"><div class="fss"><?php
echo ConvertUtil::formatDate($data['sendtime'], 'u');
?>
</div></td>
<td width="10" class="j-mark">
<a href="javascript:;" title="<?php
echo $lang['Click to mark this message'];
?>
" class="<?php
if ($data['ismark'] == 1) {
?>
o-mark<?php
} else {
?>
o-unmark<?php
}
?>
示例11:
" width="60" height="60">
</a>
</div>
<div class="cmt-body">
<p class="mbs xcm">
<strong class="xcn"><?php
echo $comment['user_info']['realname'];
?>
:</strong>
<?php
echo StringUtil::parseHtml($comment['content']);
?>
</p>
<div class="mbs fss">
<span><?php
echo ConvertUtil::formatDate($comment['ctime'], 'u');
?>
</span>
<div class="pull-right">
<a href="javascript:;" data-act="getreply" data-param='{"type":"reply","module":"message","table":"comment","rowid":"<?php
echo $comment['cid'];
?>
","name":"<?php
echo $comment['user_info']['realname'];
?>
","type":"reply"}'><?php
echo $lang['Reply'];
?>
(<?php
echo $comment['replys'];
?>
示例12:
echo $lang["Not receive"];
?>
</span>
<?php
}
?>
</td>
<td>
<span class="fss tcm"><?php
echo $val["user"]["realname"];
?>
</span>
</td>
<td>
<span class="fss tcm"><?php
echo ConvertUtil::formatDate($val["time"]);
?>
</span>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
?>
<div class="no-data-tip"></div>
<?php
}
示例13: exportExcel
public static function exportExcel($id)
{
$data = Email::model()->fetchById($id);
if ($data) {
$users = UserUtil::loadUser();
header("Cache-control: private");
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=" . ConvertUtil::iIconv($data["subject"], CHARSET, "GBK") . "(" . date("Y-m-d") . ").xls");
//$html = " <html xmlns:o=\"urn:schemas-microsoft-com:office:office\"\r\n\t\txmlns:x=\"urn:schemas-microsoft-com:office:excel\"\r\n\t\txmlns=\"http://www.w3.org/TR/REC-html40\">\r\n\t\t<head>\r\n\t\t<title></title>\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n\t\t</head>\r\n\t\t<body topmargin=\"5\">\r\n\t\t <table border=\"1\" cellspacing=\"1\" width=\"95%\" class=\"small\" cellpadding=\"3\">\r\n\t\t\t<tr style=\"BACKGROUND: #D3E5FA; color: #000000; font-weight: bold;\">\r\n\t\t\t <td align=\"center\">收件人:</td>\r\n\t\t\t <td align=\"center\">发件人:</td>\r\n\t\t\t <td align=\"center\">抄送:</td>\r\n\t\t\t <td align=\"center\">重要性:</td>\r\n\t\t\t <td align=\"center\">标题:</td>\r\n\t\t\t <td align=\"center\">发送时间:</td>\r\n\t\t\t <td align=\"center\">内容:</td>\r\n\t\t\t <td align=\"center\">附件名称:</td>\r\n\t\t\t</tr> ";
$html = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body topmargin="5">
<table border="1" cellspacing="1" width="95%" class="small" cellpadding="3">
<tr style="BACKGROUND: #D3E5FA; color: #000000; font-weight: bold;">
<td align="center">收件人:</td>
<td align="center">发件人:</td>
<td align="center">抄送:</td>
<td align="center">重要性:</td>
<td align="center">标题:</td>
<td align="center">发送时间:</td>
<td align="center">内容:</td>
<td align="center">附件名称:</td>
</tr>';
$data["toname"] = self::joinStringByArray($data["toids"], $users, "realname", ";");
$data["content"] = str_replace(" ", " ", $data["content"]);
$data["content"] = str_replace("\n", "<br>", $data["content"]);
$data["fromname"] = isset($users[$data["fromid"]]) ? $users[$data["fromid"]]["realname"] : "";
$data["copytoname"] = self::joinStringByArray($data["copytoids"], $users, "realname", ";");
$important_desc = "";
if ($data["important"] == "0") {
$important_desc = "";
} elseif ($data["important"] == "1") {
$important_desc = "<font color=\"#ff6600\">一般邮件</font>";
} elseif ($data["important"] == "2") {
$important_desc = "<font color=\"#FF0000\">重要邮件</font>";
}
$attachmentname = "";
if ($data["attachmentid"] !== "") {
$tempdata = AttachUtil::getAttach($data["attachmentid"]);
foreach ($tempdata as $value) {
$attachmentname .= $value["filename"] . "; ";
}
}
$data["sendtime"] = ConvertUtil::formatDate($data["sendtime"]);
//$html .= "\r\n <tr>\r\n <td nowrap align=\"center\">" . $data["toname"] . "</td>\r\n <td nowrap align=\"center\">" . $data["fromname"] . "</td>\r\n <td>" . $data["copytoname"] . "</td>\r\n <td nowrap align=\"center\">" . $important_desc . "</td>\r\n <td nowrap>" . $data["subject"] . "</td>\r\n <td nowrap align=\"center\" x:str=\"" . $data["sendtime"] . "\">" . $data["sendtime"] . "</td>\r\n <td>" . $data["content"] . "</td>\r\n <td>" . $attachmentname . "</td>\r\n </tr>\r\n </table>";
$html .= '<tr>
<td nowrap align="center">' . $data["toname"] . '</td>
<td nowrap align="center">' . $data["fromname"] . '</td>
<td>' . $data["copytoname"] . '</td>
<td nowrap align="center">' . $important_desc . '</td>
<td nowrap>' . $data["subject"] . '</td>
<td nowrap align="center" x:str="' . $data["sendtime"] . '">' . $data["sendtime"] . '</td>
<td>' . $data["content"] . '</td>
<td>' . $attachmentname . '</td>
</tr></table>';
echo $html;
}
}
示例14:
" width="60" height="60">
</a>
</div>
<div class="cmt-body">
<p class="mbs xcm">
<strong class="xcn"><?php
echo $comment["user_info"]["realname"];
?>
:</strong>
<?php
echo StringUtil::parseHtml($comment["content"]);
?>
</p>
<div class="mbs fss">
<span><?php
echo ConvertUtil::formatDate($comment["ctime"], "u");
?>
</span>
<div class="pull-right">
<a href="javascript:;" data-act="getreply" data-param='{"type":"reply","module":"message","table":"comment","rowid":"<?php
echo $comment["cid"];
?>
","name":"<?php
echo $comment["user_info"]["realname"];
?>
","type":"reply"}'><?php
echo $lang["Reply"];
?>
(<?php
echo $comment["replys"];
?>
示例15: execRule
public function execRule($action, $uid = 0, $needle = "", $coef = 1, $update = 1)
{
$this->_coef = $coef;
$uid = intval($uid);
$rule = $this->getRule($action);
$updateCredit = false;
$timestamp = TIMESTAMP;
$enabled = false;
if ($rule) {
for ($i = 1; $i <= 5; $i++) {
if (!empty($rule["extcredits" . $i])) {
$enabled = true;
break;
}
}
}
if ($enabled) {
$ruleLog = $this->getRuleLog($rule["rid"], $uid);
if ($ruleLog && $rule["norepeat"]) {
$ruleLog = array_merge($ruleLog, $this->getCheckLogByClId($ruleLog["clid"], $uid));
$ruleLog["norepeat"] = $rule["norepeat"];
}
if ($rule["rewardnum"] && $rule["rewardnum"] < $coef) {
$coef = $rule["rewardnum"];
}
if (empty($ruleLog)) {
$logArr = array("uid" => $uid, "rid" => $rule["rid"], "total" => $coef, "cyclenum" => $coef, "dateline" => $timestamp);
if (in_array($rule["cycletype"], array(2))) {
$logArr["starttime"] = $timestamp;
} else {
$logArr["starttime"] = 0;
}
$logArr = $this->addLogArr($logArr, $rule, false);
if ($update) {
$clid = CreditRuleLog::model()->add($logArr, true);
if ($rule["norepeat"]) {
$ruleLog["isnew"] = 1;
$ruleLog["clid"] = $clid;
$ruleLog["uid"] = $uid;
$ruleLog["norepeat"] = $rule["norepeat"];
$this->updateCheating($ruleLog, $needle, true);
}
}
$updateCredit = true;
} else {
$newCycle = false;
$logArr = array();
switch ($rule["cycletype"]) {
case 1:
break;
case 2:
$nextCycle = 0;
if ($ruleLog["starttime"]) {
if ($rule["cycletype"] == 2) {
$start = strtotime(ConvertUtil::formatDate($ruleLog["starttime"], "Y-m-d H:00:00"));
$nextCycle = $start + $rule["cycletime"] * 3600;
} else {
$nextCycle = $ruleLog["starttime"] + $rule["cycletime"] * 60;
}
}
if ($timestamp <= $nextCycle && $ruleLog["cyclenum"] < $rule["rewardnum"]) {
if ($rule["norepeat"]) {
$repeat = $this->checkCheating($ruleLog, $needle, $rule["norepeat"]);
if ($repeat && !$newCycle) {
return false;
}
}
if ($rule["rewardnum"]) {
$remain = $rule["rewardnum"] - $ruleLog["cyclenum"];
if ($remain < $coef) {
$coef = $remain;
}
}
$logArr = array("cyclenum" => "cyclenum=cyclenum+'{$coef}'", "total" => "total=total+'{$coef}'", "dateline" => "dateline='{$timestamp}'");
$updateCredit = true;
} elseif ($nextCycle <= $timestamp) {
$newCycle = true;
$logArr = array("cyclenum" => "cyclenum={$coef}", "total" => "total=total+'{$coef}'", "dateline" => "dateline='{$timestamp}'", "starttime" => "starttime='{$timestamp}'");
$updateCredit = true;
}
break;
case 3:
if ($rule["cycletype"] == 3) {
$today = strtotime(date("Y-m-d", $timestamp));
if ($ruleLog["dateline"] < $today && $rule["rewardnum"]) {
$ruleLog["cyclenum"] = 0;
$newCycle = true;
}
}
if (empty($rule["rewardnum"]) || $ruleLog["cyclenum"] < $rule["rewardnum"]) {
if ($rule["norepeat"]) {
$repeat = $this->checkCheating($ruleLog, $needle, $rule["norepeat"]);
if ($repeat && !$newCycle) {
return false;
}
}
if ($rule["rewardnum"]) {
$remain = $rule["rewardnum"] - $ruleLog["cyclenum"];
if ($remain < $coef) {
$coef = $remain;
//.........这里部分代码省略.........