本文整理汇总了PHP中XDateTime::secondDiff方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::secondDiff方法的具体用法?PHP XDateTime::secondDiff怎么用?PHP XDateTime::secondDiff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDateTime
的用法示例。
在下文中一共展示了XDateTime::secondDiff方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
{
foreach($rows as $teleconfPartner)
{
$startTime = $teleconfPartner->startTime;
$endTime = $teleconfPartner->endTime;
?>
<tr>
<td><?=$teleconfPartner->teleconference->orderId?></td>
<td><?=$teleconfPartner->teleconference->confid?></td>
<td><?=$teleconfPartner->phone?></td>
<td><?=TeleconferencePartner::$rolename[$teleconfPartner->role]?></td>
<td><?=$startTime->isZero() ? '0':$startTime->toString()?></td>
<td><?=$endTime->isZero() ? '0':$endTime->toString() ?></td>
<td>
<?php
$totalTime = $startTime->isZero() || $endTime->isZero() ? 0 : XDateTime::secondDiff($startTime, $endTime);
$minutes = floor($totalTime / 60);
$seconds = $totalTime % 60;
echo "{$minutes}分{$seconds}秒";
?>
</td>
</tr>
<?php }
} ?>
</table>
<p><?php echo $pageLink; ?></p>
</div>
</div>
<!--end rpt element-->
</body>
</html>
示例2: updatePublishInfo
public function updatePublishInfo($request , $response)
{
$id = $request->getRequest('id') ;
$userName = $request->getRequest('defaultUserName');
$user = DAL::get()->find_by_name('User',$userName);
$info = array();
$info['isconfirmed'] = 0 ;
$info['user'] = $user ;
$info['title'] = $request->getRequest('title') ;
$info['content'] = $request->getRequest('content') ;
$info['state'] = $request->getRequest('state') ;
$year = $request->getRequest('year') ;
$month = $request->getRequest('month') ;
$day = $request->getRequest('day') ;
$info['effectivetime'] = "$year-$month-$day" ;
if(checkdate($month,$day,$year) == false)
throw new BizException('有效期限日期不合法');
$extime = XDateTime::valueOf($info['effectivetime']);
if(XDateTime::secondDiff(XDateTime::now(),$extime) < 1)
{
throw new BizException('有效时间从明天开始,不能选择今天和之前的日期');
}
OfficialPublishClient::getInstance()->updatePublishInfo($id,$info) ;
$publishInfo = DAL::get()->find('OfficialPublishInfo', $id);
$publishInfo->hospital->refreshOfficialPublishCache();
$type = $request->getRequest('type');
$url = $response->router->urlfor('admin/showpublishinfo?type='.$type) ;
$response->setRedirect($url) ;
}
示例3: getAliPayItemList
public function getAliPayItemList($request, $response)
{/*{{{*/
//第一次查询列表
$isFirstQuery = $request->query;
$depositeId = $request->depositeId;
$failDepositeOrderIds = array();
$page = $request->page ? $request->page : 1;
$pageSize = 100;
$startMinute = $request->startMinute;
$endMinute = $request->endMinute;
$startNormalTime = $request->getRequest('startTime', XDateTime::now()->toShortString());
$startTime = $startNormalTime.' '.$request->getRequest('startHour', '00').':'.$request->getRequest('startMinute', '00').':00';
$endTime = $startNormalTime.' '.$request->getRequest('endHour', '23').':'.$request->getRequest('endMinute', '00').':59';
DBC::requireTrue(XDateTime::secondDiff(XDateTime::valueOf($endTime), XDateTime::valueOf($startTime)) <= 0 , "结束时间不能大于开始时间");
$isSuccess = false;
$returnItems = array();
//第一次查询isFirstQuery有值
if(empty($isFirstQuery))
{/*{{{*/
$itemUrl = Alipay::getInstance()->getPayItemList($page, $pageSize, $startTime, $endTime);
$xml = file_get_contents($itemUrl);
$itemValues = simplexml_load_string($xml);
if($itemValues->is_success == 'T')
{
$i = 0;
$isSuccess = true;
$xmlResponse = $itemValues->response;
$account_page_query_result = $xmlResponse->account_page_query_result;
$response->hasNextPage = $account_page_query_result->has_next_page && $account_page_query_result->has_next_page == 'T';
$account_log_list = $account_page_query_result->account_log_list;
$AccountQueryAccountLogVO = $account_log_list->AccountQueryAccountLogVO;
foreach($AccountQueryAccountLogVO as $item)
{
$i++;
$items = array();
$depositeOrderId = strstr($item->merchant_out_order_no,'_', true);
if($item->income > 0 && $item->outcome == 0 )
{
$items = $this->getAllAliPayList($item, $depositeOrderId, $items);
//查询全部
if(empty($depositeId))
{
$returnItems[$i] = $items;
}
else if ($depositeId == $depositeOrderId)
{
$returnItems[$i] = $items;
}
//区间内最多50条status为fail的记录
$failDepositeId = $this->getFailDepositeOrderIds($items, $depositeOrderId);
$failDepositeOrderIds[] = $failDepositeId;
}
}
}
else
{
$response->errorMsg = $itemValues->error;
}
}/*}}}*/
//充值失败充值单
$failDepositeOrders = DAL::get()->find('depositeorder', $failDepositeOrderIds);
$response->failDepositeOrders = $failDepositeOrders;
$response->items = $returnItems;
$response->isSuccess = $isSuccess;
$response->startHour = $request->startHour;
$response->endHour = $request->endHour;
$response->startTime = $request->startTime;
$response->startMinute = $request->startMinute;
$response->endMinute = $request->endMinute;
$response->page = $page;
$response->depositeId = $depositeId;
}/*}}}*/
示例4:
?>
</td>
<td nowrap class="w100"><?php
echo $conversation->startTime->isZero() ? '-' : $conversation->startTime;
?>
</td>
<td nowrap class="w100"><?php
echo $conversation->endTime->isZero() ? '-' : $conversation->endTime;
?>
</td>
<td nowrap class="w60"><?php
echo $conversation->direction ? '' : ($conversation->isEnd() ? XDateTime::secondDiff($conversation->customerStartQueuingTime, $conversation->startTime) . '秒' : '-' . '秒');
?>
</td>
<td nowrap class="w60"><?php
echo $conversation->isEnd() ? XDateTime::secondDiff($conversation->startTime, $conversation->endTime) : '-';
?>
秒</td>
<td nowrap class="w60"><?php
echo $conversation->getTeleOperator()->realName;
?>
</td>
<td nowrap class="w60"><?php
echo $conversation->getTeleOperator()->workId;
?>
</td>
<td nowrap class="w80"><?php
echo $conversation->serviceQueue->returnQueueName();
?>
</td>
<td nowrap class="w80"><?php
示例5: floor
if($teleConfOwner->phoneConference->isNull()) continue;
?>
<tr>
<td><?=$teleConfOwner->phoneConference->ctime->toStringByFormat('Y-m-d')?></td>
<td><?=$teleConfOwner->phoneConference->ctime->toStringByFormat('H:i:s')?></td>
<td><?=$teleConfOwner->phoneConference->startChargeTime->isZero() ? 0 : $teleConfOwner->phoneConference->startChargeTime->toStringByFormat('H:i:s')?></td>
<td><?=$teleConfOwner->phoneConference->endTime->isZero() ? 0 : $teleConfOwner->phoneConference->endTime->toStringByFormat('H:i:s')?></td>
<td>
<?php $totalTime = $teleConfOwner->phoneConference->endTime->isZero() ? 0 : XDateTime::secondDiff($teleConfOwner->phoneConference->ctime, $teleConfOwner->phoneConference->endTime);
$minutes = floor($totalTime / 60);
$seconds = $totalTime % 60;
echo "{$minutes}分{$seconds}秒";
?>
</td>
<td>
<?php $zixunTime = $teleConfOwner->phoneConference->endTime->isZero() || $teleConfOwner->phoneConference->startChargeTime->isZero() ? 0 : XDateTime::secondDiff($teleConfOwner->phoneConference->startChargeTime, $teleConfOwner->phoneConference->endTime);
$minutes = floor($zixunTime / 60);
$seconds = $zixunTime % 60;
echo "{$minutes}分{$seconds}秒";
?>
</td>
<td><?=$teleConfOwner->adminUser->name?></td>
<td><?=$teleConfOwner->phoneConference->getAdmin()->phoneNumber?></td>
<td><?=$teleConfOwner->phoneConference->spType ?></td>
<td><a href="<?=$teleConfOwner->phoneConference->getRecordUrl()?>" target="_blank">下载</a></td>
<td><a target="_blank" href="/paymentfront/telconference/confmemberlist?confid=<?=$teleConfOwner->confid?>&confownerid=<?=$teleConfOwner->id?>">查看</a></td>
</tr>
<?php
}
?>
</table>
示例6: floor
{
?>
<tr>
<td><?=$teleconf->ctime->toStringByFormat('Y-m-d')?></td>
<td><?=$teleconf->ctime->isZero() ? 0 : $teleconf->ctime->toStringByFormat('H:i:s')?></td>
<td><?=$teleconf->starttime->isZero() ? 0 : $teleconf->starttime->toStringByFormat('H:i:s')?></td>
<td><?=$teleconf->getEndTime2()->isZero() ? 0 : $teleconf->getEndTime2()->toStringByFormat('H:i:s')?></td>
<td>
<?php $totalTime = $teleconf->getEndTime2()->isZero() ? 0 : XDateTime::secondDiff($teleconf->ctime, $teleconf->getEndTime2());
$minutes = floor($totalTime / 60);
$seconds = $totalTime % 60;
echo "{$minutes}分{$seconds}秒";
?>
</td>
<td>
<?php $zixunTime = $teleconf->getEndTime2()->isZero() || $teleconf->starttime->isZero() ? 0 : XDateTime::secondDiff($teleconf->starttime, $teleconf->getEndTime2());
$minutes = floor($zixunTime / 60);
$seconds = $zixunTime % 60;
echo "{$minutes}分{$seconds}秒";
?>
</td>
<td><?=$teleconf->adminUserName?></td>
<td><?=$teleconf->getPartnerByRole(TeleconferencePartner::ADMIN)->phone?></td>
<td><a target="_blank" href="<?=$teleconf->getVoiceUrl()?>">下载</a></td>
<td><a target="_blank" href="teleconfstatisticsdetail?confid=<?=$teleconf->confid?>">查看</a></td>
</tr>
<?php
}
?>
</table>
<!--end frameLeft-table element-->
示例7: getCallDuration
private function getCallDuration($spCallId)
{/*{{{*/
$member = DAL::get()->find_by_spcallid('ConferenceMember', $spCallId, true);
if(false == $member->isNull() && false == $member->startTime->isZero())
{
return XDateTime::secondDiff($member->startTime,XDateTime::now());
}
return 0;
}/*}}}*/
示例8: 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;
//.........这里部分代码省略.........
示例9: if
';
}
else if( 1 == '<?php
echo $teleConversation->isEnd();
?>
')
{
var time = '<?php
echo XDateTime::secondDiff($teleConversation->startTime, $teleConversation->endTime);
?>
';
}
else
{
var time = '<?php
echo XDateTime::secondDiff($teleConversation->startTime, XDateTime::now());
?>
';
}
c = parseInt(time);
timedCount(c) ;
$(".saveremark").click( function() {
$('.saveMsg').html('正在保存');
$('.saveMsg').fadeOut(3000);
$.post('/operator/saveremark', $('.conversationForm').serialize(), function (data){
window.location.reload();
});
});
$.post('/operator/userinfobyphone', {'phone':'<?php
echo $teleConversation->customerPhoneNumber;