本文整理汇总了PHP中XDateTime::monthDiff方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::monthDiff方法的具体用法?PHP XDateTime::monthDiff怎么用?PHP XDateTime::monthDiff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDateTime
的用法示例。
在下文中一共展示了XDateTime::monthDiff方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: if
<?php }?>
</div>
<div class="clearfix mb1">
<div class="order-d-box-l fl fb tr">产品标准:</div>
<div class="order-d-box-r fl">
<span class="fb">
<?= $price ?>
</span>
</div>
</div>
<div class="clearfix">
<div class="order-d-box-l fl fb tr">上次在线:</div>
<div class="order-d-box-r fl red">
<?php if(false == $order->getExecuterBySpace()->isNull()){
echo $order->getExecuterBySpace()->getDoctorActiveTime();
if(XDateTime::monthDiff($order->getExecuterBySpace()->activityTime,XDateTime::now()) > 1)
{
echo "<span class='blue' style='font-size:16px;'>长时间未登录</span>";
}
}else{
echo "--";
}?>
</div>
</div>
<div class="clearfix">
<div class="order-d-box-l fl fb tr">咨询范围:</div>
<?php $content = ($order->getExecuterBySpace()->isNull())?'':$order->getExecuterBySpace()->commonCaseNote;
if(mb_strlen($content, 'gbk')>40)
{
echo "<span name='xiang' class='none'>{$content}<a class='spanShowMore blue cp'>收起>></a></span>";
echo "<span name='jian'>";
示例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;
//.........这里部分代码省略.........