本文整理汇总了PHP中XDateTime::minuteDiff方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::minuteDiff方法的具体用法?PHP XDateTime::minuteDiff怎么用?PHP XDateTime::minuteDiff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDateTime
的用法示例。
在下文中一共展示了XDateTime::minuteDiff方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkOverTimeTickets
private function checkOverTimeTickets()
{/*{{{*/
$content = '';
$tickets = $this->getOverTimeTickets();
foreach ($tickets as $ticket)
{
$minutes = XDateTime::minuteDiff($ticket->utime, XDateTime::now());
if ($minutes > $this->maxBindTime)
{
$content .= $this->formatAlertContent($ticket, $minutes);
}
}
$this->sendEmail($content);
}/*}}}*/
示例2: showOrderList
public function showOrderList($request, $response)
{/*{{{*/
$orderId = $request->orderid;
$status = $request->type;
$beginDate = $request->beginDate;
$endDate = $request->endDate ? $request->endDate : XDateTime::now()->today()->toShortString();
$page = $request->page?$request->page : 1;
$pageSize = 20;
$telOwner = DAL::get()->find_by_relatedObject('telowner', $this->_newSpace->user);
$options = array();
$options['orderId'] = $orderId;
if($status != TelOrder::SEARCH_FINISHED_CLOSE)
{
$options['desc'] = 'asc';
}
$res = TelOrderClient::getInstance()->getList($status, $page, $pageSize, $telOwner->id, $options);
$pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("showorderlist?type=$status&orderId=$orderId&actionclass=$request->actionclass&page="),$res['pageInfo']['nowpage'],$res['pageInfo']['pagesize'],$res['pageInfo']['total']);
$waittimearray = array();
$waittimeall = 0;
$visitordersarray = array();
$now = XDateTime::now();
foreach($res['list'] as $telOrder)
{
$confirmtime = $telOrder->confirmStartTime;
if(($telOrder->status != TelOrder::STATUS_FINISHED && $telOrder->status != TelOrder::STATUS_CLOSED) || $confirmtime > $now)
{
$confirmtime = $now;
}
$paytime = $telOrder->payTime;
if(XDateTime::valueOf($telOrder->payTime)->isZero() == true)
{
$paytime = $telOrder->ctime;
}
$visitOrder = DAL::get()->find_by_orderid('TelVisit', $telOrder->id);
$flow = DAL::get()->find_by_patientid_and_spaceid('DoctorPatientRef',
$telOrder->patient->id, $telOrder->executer->relatedObject->id);
if($visitOrder->isNull() == false && $flow->isNull() == false && $visitOrder->rank != TelVisit::RANK_ZERO && $visitOrder->content != '')
{
$visitordersarray[$telOrder->id] = true;
}
if($telOrder->status == TelOrder::STATUS_FINISHED || $telOrder->status == TelOrder::STATUS_CLOSED || $telOrder->status == TelOrder::STATUS_CONFIRM)
{
$waittimearray[$telOrder->id] = XDateTime::monthDiff($paytime,$confirmtime)."月";
if($waittimearray[$telOrder->id] <= 0)
{
$waittimearray[$telOrder->id] = XDateTime::dayDiff($paytime,$confirmtime)."天";
if($waittimearray[$telOrder->id] <= 0)
{
$waittimearray[$telOrder->id] = XDateTime::HourDiff($paytime,$confirmtime)."小时";
if($waittimearray[$telOrder->id] <= 0)
{
$waittimearray[$telOrder->id] = XDateTime::minuteDiff($paytime,$confirmtime)."分";
if($waittimearray[$telOrder->id] <= 0)
{
$waittimearray[$telOrder->id] = XDateTime::minuteDiff($paytime,$confirmtime)."秒";
if($waittimearray[$telOrder->id] <= 0)
{
$waittimearray[$telOrder->id] = 0;
}
}
}
}
}
}
if(XDateTime::secondDiff($paytime,$confirmtime) > 0)
{
$waittimeall += XDateTime::secondDiff($paytime,$confirmtime);
}
}
$avgtime = "0天";
if(count($res['list']) > 0)
{
$avgtimeall = $waittimeall/count($res['list']);
$avgtime = floor($avgtimeall/2592000)."月";
if(($avgtimeall/2592000) < 1)
{
$avgtime = floor($avgtimeall/86400)."天";
}
if($avgtimeall/86400 < 1)
{
$avgtime = floor($avgtimeall/3600)."小时";
}
if($avgtimeall/3600 < 1)
{
$avgtime = floor($avgtimeall/60)."分";
}
}
$response->waittimearray = $waittimearray;
$response->avgtime = $avgtime;
$response->orderid = $orderId;
$response->visitordersarray = $visitordersarray;
$response->telOrderList = $res['list'];
$response->space = $this->_newSpace;
$response->beginDate = $beginDate;
$response->endDate = $endDate;
$response->pagelink = $pagelink;
$response->type = $status;
$response->telOwner = $telOwner;
$response->actionClass = $request->actionclass;
//.........这里部分代码省略.........