当前位置: 首页>>代码示例>>PHP>>正文


PHP XDateTime::yesterday方法代码示例

本文整理汇总了PHP中XDateTime::yesterday方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::yesterday方法的具体用法?PHP XDateTime::yesterday怎么用?PHP XDateTime::yesterday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XDateTime的用法示例。


在下文中一共展示了XDateTime::yesterday方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: noReplyProposalCnt

 public function noReplyProposalCnt($request, $response)
 {
     /*{{{*/
     $response->startCtimeOfProposal = $request->getRequest('startCtimeOfProposal', XDateTime::yesterday()->toShortString());
     $response->endCtimeOfProposal = $request->getRequest('endCtimeOfProposal', XDateTime::yesterday()->toShortString());
     $response->startHourOfProposal = $request->getRequest('startHourOfProposal', '09');
     $response->endHourOfProposal = $request->getRequest('endHourOfProposal', '22');
     $response->inspectorUserName = $request->inspectorUserName;
     $startTime = $response->startCtimeOfProposal . ' ' . $response->startHourOfProposal;
     $endTime = $response->endCtimeOfProposal . ' ' . $response->endHourOfProposal;
     $response->startTime = $startTime;
     $response->endTime = $endTime;
     $inspectorId = -1;
     if ($response->inspectorUserName != '') {
         $user = DAL::get()->find_by_fld_UserName('user', $response->inspectorUserName);
         $inspectorId = DAL::get()->find_by_userid('inspector', $user->id)->id;
     }
     $response->inspectorId = $inspectorId;
     $nowPage = $request->getRequest('page', 1);
     $pager = new XPager($nowPage, 20);
     list($cnts, $pageInfo) = DAL::get()->queryNoReplyCntOfSpaceIds('Proposal', $startTime, $endTime, $inspectorId, $pager);
     $spaces = DAL::get()->find('space', array_keys($cnts));
     $response->cnts = $cnts;
     $response->spaces = $spaces;
     $pager->total = $pageInfo['total'];
     $response->pager = $pager;
     $currentBaseUrl = '/proposal/noreplyproposalcnt?';
     $params = array("startCtimeOfProposal" => $response->startCtimeOfProposal, "endCtimeOfProposal" => $response->endCtimeOfProposal, "startHourOfProposal" => $response->startHourOfProposal, "endHourOfProposal" => $response->endHourOfProposal, "inspectorUserName" => $response->inspectorUserName, "page" => '');
     $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate(PageNav::getPageUrlByVars($currentBaseUrl, $params)), $pageInfo['nowpage'], $pageInfo['pagesize'], $pageInfo['total']);
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:30,代码来源:proposalcontroller.php

示例2: healthDiariesUnaudited

 public function healthDiariesUnaudited($request, $response)
 {
     /*{{{*/
     $taskTicketsPayingYes = DAL::get()->find_all_ByPayingStatus('nfstaskticket', FollowupOwner::PAYING_YES);
     $taskTicketsPayingNo = DAL::get()->find_all_ByPayingStatus('nfstaskticket', FollowupOwner::PAYING_NO);
     $tickets = array();
     foreach ($taskTicketsPayingYes as $ticketYes) {
         if (empty($tickets[$ticketYes->ctime->getHour()])) {
             $tickets[$ticketYes->ctime->getHour()]['payingYes'] = 0;
         }
         $tickets[$ticketYes->ctime->getHour()]['payingYes'] = $tickets[$ticketYes->ctime->getHour()]['payingYes'] + 1;
     }
     foreach ($taskTicketsPayingNo as $ticketNo) {
         if (empty($tickets[$ticketNo->ctime->getHour()]['payingNo'])) {
             $tickets[$ticketNo->ctime->getHour()]['payingNo'] = 0;
         }
         $tickets[$ticketNo->ctime->getHour()]['payingNo'] = $tickets[$ticketNo->ctime->getHour()]['payingNo'] + 1;
     }
     // merge from 0 to 8
     $first8hours = range(0, 8);
     $countYes = 0;
     $countNo = 0;
     foreach ($tickets as $duration => $counts) {
         if (in_array($duration, $first8hours)) {
             if (false == empty($counts['payingYes'])) {
                 $countYes = $counts['payingYes'] + $countYes;
             }
             if (false == empty($counts['payingNo'])) {
                 $countNo = $counts['payingNo'] + $countNo;
             }
             unset($tickets[$duration]);
         }
     }
     $tickets['0-8']['payingYes'] = $countYes;
     $tickets['0-8']['payingNo'] = $countNo;
     ksort($tickets);
     $response->tickets = $tickets;
     $payArr = array('payingYes' => FollowupOwner::PAYING_YES, 'payingNo' => FollowupOwner::PAYING_NO);
     $cateCnts = array();
     foreach ($payArr as $key => $value) {
         $cateCnts['高危'][$key] = DAL::get()->queryUnAuditedCountByOptions('nfstaskticket', array('payingStatus' => $value, 'riskLevel' => HealthDangerFactorCalcBase::LEVEL_RISK_HIGH));
         $cateCnts['重病'][$key] = DAL::get()->queryUnAuditedCountByOptions('nfstaskticket', array('payingStatus' => $value, 'isSerious' => FollowupCustomer::ISSERIOUS_YES));
         $cateCnts['文字记录'][$key] = DAL::get()->queryUnAuditedCountByOptions('nfstaskticket', array('payingStatus' => $value, 'hasContent' => 1));
         $cateCnts['今天'][$key] = DAL::get()->queryUnAuditedCountByOptions('nfstaskticket', array('payingStatus' => $value, 'startTime' => XDateTime::yesterday()->addHour(18), 'endTime' => XDateTime::today()->addHour(18)));
         $cateCnts['昨天'][$key] = DAL::get()->queryUnAuditedCountByOptions('nfstaskticket', array('payingStatus' => $value, 'startTime' => XDateTime::yesterday()->addHour(-6), 'endTime' => XDateTime::yesterday()->addHour(18)));
         $cateCnts['之前'][$key] = DAL::get()->queryUnAuditedCountByOptions('nfstaskticket', array('payingStatus' => $value, 'endTime' => XDateTime::yesterday()->addHour(-6)));
     }
     $response->cateCnts = $cateCnts;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:49,代码来源:followupcontroller.php

示例3: statistics

 private function statistics($request, $response)
 {
     /*{{{*/
     $thankLetterCount = 0;
     if ($this->space->isDoctor()) {
         $thankLetterCount = $this->space->host->getCureThankLetterCount();
     }
     $response->thankLetterCount = $thankLetterCount;
     $spaceRepliedCount = SpaceClient::getInstance()->getCountOfRepliedFlowsCount($this->space->id, $this->user->id);
     $response->spaceRepliedCount = $spaceRepliedCount != 0 ? $spaceRepliedCount : $this->space->caseCount;
     $doctorVoteCnt = 0;
     $diseaseList = DiseaseClient::getInstance()->getDiseaseDoctorList(array($this->space->host->primaryId));
     foreach ($diseaseList as $idx => $diseaseDoctor) {
         if ($diseaseDoctor->goodVoteCount > 0) {
             $doctorVoteCnt += $diseaseDoctor->goodVoteCount;
         }
     }
     $response->doctorVoteCnt = $doctorVoteCnt;
     //礼物数
     $response->presentCnt = PresentClient::getInstance()->getCntOfPresent($this->space->id);
     //昨日诊后报到
     $time = XDateTime::yesterday();
     $startTime = $time->toShortString();
     $endTime = $startTime . ' 23:59:59';
     $yesterdaySigninCnt = DAL::get()->querySubsidyCntByTimeSpan('SubsidyOrder', $this->space->id, $startTime, $endTime);
     $totalSigninCnt = DAL::get()->queryCntByTimeSpan('PatientSignin', $this->space->id);
     $response->totalSigninCnt = $totalSigninCnt;
     $response->yesterdaySigninCnt = $yesterdaySigninCnt;
     //诊后报到患者
     $response->yesterdayCnt = DZoneClient::getInstance()->getYesterdayHits('spacehit', $this->space->id);
     $response->yesterdayDate = date("y-m-d", time() - 3600 * 24);
     $response->docLastOnlineTime = $this->space->getLastOnlineTimeStr();
     $response->openSpaceTime = date("Y-m-d H:i", $this->space->ctime->getTime());
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:34,代码来源:indexcontroller.php

示例4: newPhoneStatisticsList

 public function newPhoneStatisticsList($request, $response)
 {
     /*{{{*/
     $type = $request->getRequest('type', PhoneStatistics::SEARCH_TYPE_ALL);
     $from = $request->getRequest('from', XDateTime::yesterday()->toShortString());
     $to = $request->getRequest('to', XDateTime::today()->toShortString());
     $phoneStatisticsList = StationLetterClient::getInstance()->getPhoneStatistics($from, $to);
     $response->phoneStatisticsList = $phoneStatisticsList;
     $response->from = $from;
     $response->to = $to;
     $dateList = array();
     foreach ($phoneStatisticsList as $phoneStatistics) {
         $dateList[$phoneStatistics->logTime->toShortString()][$phoneStatistics->dataType] = $phoneStatistics;
     }
     $response->dateList = $dateList;
     $response->dataTypeDef = PhoneStatistics::displayByType($type);
     $response->type = $type;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:18,代码来源:wapcontroller.php


注:本文中的XDateTime::yesterday方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。