當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XDateTime::minuteDiff方法代碼示例

本文整理匯總了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);
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:14,代碼來源:inspect.php

示例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;
//.........這裏部分代碼省略.........
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:101,代碼來源:adminpaymentcontroller.php


注:本文中的XDateTime::minuteDiff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。