本文整理汇总了PHP中XDateTime::today方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::today方法的具体用法?PHP XDateTime::today怎么用?PHP XDateTime::today使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDateTime
的用法示例。
在下文中一共展示了XDateTime::today方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: androidMedicineRemind
public function androidMedicineRemind($request, $response)
{
/*{{{*/
$userId = $request->userId;
$user = DAL::get()->find('user', $userId);
$remoter = new RequestDelegate();
$url = "http://" . URL_PREFIX . "mobile-api.haodf.com/followup/mobileapi/getMedicineRemindList";
//"fa28bd37cd7f397fbd088649c1d09af8"为手机客户端followup对应密钥
$cryptedUserId = $this->cryptWithKey(json_encode(array("userId" => $userId)), "fa28bd37cd7f397fbd088649c1d09af8");
$args = array('os' => 'android', 'app' => 'followup', 'version' => 'fu1.0', '_s' => $cryptedUserId);
$res = $remoter->request($url, 'get', $args);
$res = json_decode($res);
$todayRemindList = array();
$remindList = $res->content;
foreach ($remindList as &$remind) {
$remind->problemTitle = mb_convert_encoding($remind->problemTitle, 'gbk', 'utf-8');
if ($remind->remindIntervalDay == 1) {
$todayRemindList[] = $remind;
} else {
$today = XDateTime::today();
$checkTime = XDateTime::valueOf($remind->remindCheckTime);
$dayDiff = XDateTime::dayDiff($today, $checkTime);
$intervalDay = $remind->remindIntervalDay;
if (fmod($dayDiff, $intervalDay) == 0) {
$todayRemindList[] = $remind;
}
}
}
$response->todayRemindList = $todayRemindList;
$response->remindData = $remindList;
$response->userId = $userId;
$response->userName = $user->name;
}
示例2: newArticlePost
/** 创建文章提交(D,HF) */
public function newArticlePost($request, $response)
{/*{{{*/
if (XString::cntrim($request->getRequest('article_title')) == '') {
$this->message('文章标题不能为空', $response);
return false;
}
$todayHasArticleNumber = DAL::get()->queryCntOfSpace('Article', $this->_newSpace->id, XDateTime::today()->toString(), XDateTime::tomorrow()->addSecond(-1)->toString());
if(Article::MAX_CAN_ARTICLE_ONE_DAY_ADD_TWO <= $todayHasArticleNumber)
{
$this->message("您今天已经发表了".Article::MAX_CAN_ARTICLE_ONE_DAY_ADD_TWO."篇文章,请您明天再发表", $response);
return false;
}
$categoryId = intval($request->getRequest('category_id', 0));
$data = array();
$data['tags'] = $request->article_tags;
$data['topLevel'] = $request->top_level;
$data['docAttachmentId'] = $request->getRequest('docAttachmentId', 0);
$articleSource = intval($request->article_source);
if(!$articleSource)
{
$this->message("文章来源不能为空", $response);
return false;
}
$article = ArticleClient::getInstance()->addArticle($this->_newSpace, $categoryId, $request->article_title, $request->getUnSafeData('article_content'), $articleSource, $data);
if($article->isNull()){
$this->message('系统繁忙,请稍后再试', $response, array('text' => '返回文章列表',
'url' => $response->router->urlfor('article/index')));
return false;
}
$response->setRedirect($this->_newSpace->getUrl().'adminarticle/newpostcomplete?id='.$article->id);
}/*}}}*/
示例3: validate
public function validate()
{/*{{{*/
$unexecutedTaskCnt = count(DAL::get()->find_id_afterCtimeAndStatus('QueueTask', XDateTime::today()->addDay(-1), QueueTask::STATUS_UNEXECUTED));
if($unexecutedTaskCnt > self::WARNING_CNT)
{
return "定时任务积压:{$unexecutedTaskCnt}";
}
}/*}}}*/
示例4: setErrorCode
public function setErrorCode($value)
{/*{{{*/
$this->errorCode = $value;
$this->content = array();
$this->msg = $this->getMsg();
if($value == 203)
{
$this->msg = '请检查您的时间是否设置正确, 当前时间为:'.XDateTime::today('Y-m-d H:i')->toStringByFormat('Y-m-d H:i');
}
$this->pageInfo = array();
return $this;
}/*}}}*/
示例5: showTaskList
public function showTaskList($request, $response)
{
/*{{{*/
$someDayDateStr = $request->getRequest('somedaydatestr', XDateTime::today()->toShortString());
$queryType = $request->getRequest('querytype', 'num');
$lastnum = $request->getRequest('lastnum', 100);
$someDay = XDateTime::valueOf($someDayDateStr);
if ($queryType == 'time') {
$response->taskList = DAL::get()->find_all_byTaskTemplateIdAndCtimeBetween('QueueTask', $request->tasktemplateid, $someDay, $someDay->addDay(1));
} else {
$response->taskList = DAL::get()->find_all_InRecentTimes('QueueTask', $request->tasktemplateid, $lastnum);
}
$response->someDayDateStr = $someDayDateStr;
$response->taskTemplate = DAL::get()->find('TaskTemplate', $request->tasktemplateid);
$response->queryType = $queryType;
$response->lastnum = $lastnum;
}
示例6: addBingli
public function addBingli($request, $response)
{
$data = $request->getUnSafeData('attachment');
$data['title'] = Request::filter($data['title']);
$data['title02'] = Request::filter($data['title02']);
if(isset($data['title01']))
{
$data['title01'] = Request::filter($data['title01']);
}
$type = isset($data['type']) ? Request::filter($data['type']) : PatientAttachment::TYPE_OTHER;
$fileType = isset($data['fileType']) ? Request::filter($data['fileType']) : 0;
$content = isset($data['content']) ? $data['content'] : '';
$timeYear = $request->getRequest('time_year', '');
$timeMonth = $request->getRequest('time_month', '');
$timeDay = $request->getRequest('time_day', '');
if($timeYear && $timeMonth && $timeDay)
$checkTime = XDateTime::createXDateTime($timeYear, $timeMonth, $timeDay);
else
$checkTime = XDateTime::today();
$title1 = '';
if(isset($data['title01']) && $data['title01'])
{
$tmp = '';
if($type == PatientAttachment::TYPE_YINGXIANG)
$tmp = '检查部位:';
else if($type == PatientAttachment::TYPE_BINGLI)
$tmp = '病理标本:';
$title1 = $tmp.$data['title01']."\n";
}
$title2 = '';
if(isset($data['title02']) && $data['title02'])
{
$title2 = '检查医院:'.$data['title02']."\n";
}
$title = $title1.$title2.$data['title'];
// 传入默认的patientid
$pa = BingLiClient::getInstance()->addBingLi($this->_newUser->id, PatientAttachment::DEFAULT_PATIENTID, $title, $type, $fileType, $content, $checkTime);
$typeName = PatientAttachment::$typeList[$type];
echo "<script>parent.myAttach('el_my_attachment', true);</script>";
exit();
}
示例7: statisticInfosAfterPayment
/**
* statisticInfosAfterPayment
* 根据(备注中含有给定的搜索条件)查出某一天中的有关订单的信息
* 页面显示相关的订单号,执行完成时间,订单状态,支付状态,医生,科室,医院,特定备注的时间,
* 负责人,和订单的付款时间,和负责人,
*/
public function statisticInfosAfterPayment($request, $response)
{/*{{{*/
$fromTime = $request->fromTime;
$remarkSelected = trim($request->remarkSelected);
$fromTime = empty($fromTime)?XDateTime::today()->addDay(-1)->toStringByFormat("Y-m-d"):$request->fromTime;
$remarkSelected = empty($remarkSelected)?TelOrderLog::$orderTypeDef[TelOrderLog::TYPE_PAY]:$remarkSelected;
$toTime = XDateTime::valueOf($fromTime)->addDay(1)->toStringByFormat("Y-m-d");
$options = array();
$options['fromTime'] = $fromTime;
$options['remarkSelected'] = $remarkSelected;
$options['toTime'] = $toTime;
$allOrderRemarks = TelOrderClient::getInstance()->getReturnInfosAfterPayment($options);
$response->fromTime = $fromTime;
$response->remarkSelected = $remarkSelected;
$response->allOrderRemarks = $allOrderRemarks;
}/*}}}*/
示例8: getBookingOrderStatus4Doctor
private function getBookingOrderStatus4Doctor($bookingOrder)
{/*{{{*/
$status = 0;
if($bookingOrder->isAudit())
{
$status = 1;
}
else if( $bookingOrder->isSpaceVisitDefault() && $bookingOrder->isFinished() && (false == $bookingOrder->isPhoneUserDefaulted() && false == $bookingOrder->isCallBackFail() && false == $bookingOrder->isCallBackSuccess() ))
{
$day = XDateTime::today()->getDateTime();
$time = XDateTime::valueOf($bookingOrder->schedule)->getDateTime();
if($day == $time)
$status = 2;
}
return $status;
}/*}}}*/
示例9: showFundStatement
public function showFundStatement($request, $response)
{
/*{{{*/
$fundAccount = $this->space->getFoundAccount();
$params = array();
$params['nowPage'] = $request->page ? $request->page : 1;
$params['pageSize'] = 20;
$defaultStartTime = XDateTime::today()->toShortString();
$defaultEndTime = XDateTime::tomorrow()->toShortString();
$settleOrders = DAL::get()->find_all_by_spaceid('SettleOrder', $this->space->id);
if (false == empty($settleOrders)) {
$settleOrders = array_reverse($settleOrders);
$defaultStartTime = $settleOrders[0]->ctime->toShortString();
}
$spaceFundAttribute = $this->space->getFundAttribute();
if ($spaceFundAttribute->isNull() == false) {
$response->spaceFundAttribute = $spaceFundAttribute;
}
$response->startTime = $params['startTime'] = $request->getRequest('startTime', $defaultStartTime);
$response->endTime = $params['endTime'] = $request->getRequest('endTime', $defaultEndTime);
$res = AccountClient::getInstance()->getPayAccountItemsOfFundAccount($fundAccount->id, $params);
$response->payAccountItems = $res['payAccountItems'];
$response->pagelink = PageNav::getNavLink(PageNav::getPageNavTemplateForSpace("showfundstatement?startTime={$response->startTime}&endTime={$response->endTime}&actionclass={$request->actionclass}&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
$response->actionClass = $request->actionclass;
$response->fundAccountAmount = $this->space->getFoundAccount()->amount;
}
示例10:
<?php
}
?>
</tr>
<?php
}
?>
</table>
<?php
}
?>
</div>
<div class="record_content">
<div>
<input id="weightdate" type="text" class="datepicker" readonly="readonly" style="width:80px;" value="<?php
echo XDateTime::today()->toShortString();
?>
" />
<input id="newweight" type="button" style="width:80px;" value="添加新记录" />
<input id="new7weight" type="button" style="width:120px;" value="添加7天新记录" />
<table class="weightlist">
<tr>
<td>时间</td>
<td>体重(KG)</td>
<td>操作</td>
</tr>
</table>
</div>
</div>
</div>
示例11: exec
exec('sh /home/avatar/bin/aladdin_rsync.sh');
echo "同步数据\n";
$this->checkSynFile();
}
}/*}}}*/
private function checkSynFile()
{/*{{{*/
exec('sh '.dirname(__FILE__).'/checksynfile.sh');
echo "检查数据同步\n";
}/*}}}*/
private function sendEmail()
{/*{{{*/
if(file_exists($this->filePath))
{
$res = file_get_contents($this->filePath);
EmailClient::getInstance()->sendSync($this->mailbox, "阿拉丁监控数据源异常", $res, $type='text/html');
unlink($this->filePath);
}
}/*}}}*/
}/*}}}*/
printf(XDateTime::today()->toShortString()."\n");
printf("开始\n");
CheckAladdin::launch();
printf("完\n");
示例12: newFromFlowPost
public function newFromFlowPost($request, $response)
{
/*{{{*/
$todayHasArticleNumber = DAL::get()->queryCntOfSpace('Article', $this->space->id, XDateTime::today()->toString(), XDateTime::tomorrow()->addSecond(-1)->toString());
DBC::requireTrue(Article::MAX_CAN_ARTICLE_ONE_DAY > $todayHasArticleNumber, "您今天已经发表了" . Article::MAX_CAN_ARTICLE_ONE_DAY . "篇文章,请您明天再发表");
$article = $this->newFromSave($request, $response);
if ($article) {
$ref = DAL::get()->find('doctorPatientRef', $request->flow_id);
$this->message('经典问答发表成功', $response, array('text' => '查看转化的经典问答', 'url' => $article->getUrl(), 'reserveText' => '返回', 'reserveUrl' => $ref->getUrl()));
}
}
示例13: foreach
<input type="hidden" name="worknoteid" value="<?php
echo $workNote->id;
?>
">
<?php
$_no_fix = 1;
foreach ($modules as $i => $module) {
$_no = $i + $_no_fix;
$_tpl = dirname(__FILE__) . "/../fu_inner/{$module}.php";
@(include_once $_tpl);
}
?>
<div style="padding:20px 0 20px 0">
<span class="fb f16">下次联系时间:</span>
<input type="text" id="worksheetdeadline" readonly="readonly" name="worksheetdeadline" value="<?php
echo XDateTime::today()->addWorkingDay(3)->toShortString();
?>
"/> (会生成一个工作单任务)
</div>
<div class="tc mt10">
<input id="submitall" type="submit" class="mr10 submitbtn" value="提交(慎重)" />
<input type="button" class="savebtn" value="保存" />
</div>
</form>
<?php
}
?>
</div>
<?php
}
示例14: dayCountByProvider
public function dayCountByProvider($request, $response)
{
$response->queues = DAL::get()->find_all_by_queuetype('ServiceQueue', array_keys(ServiceQueue::$queueTypeDesc));
$response->queueId = $request->queueId;
$response->direction = $request->direction;
$response->dateTime = $request->dateTime;
$startTime = XDateTime::today();
$endTime = XDateTime::tomorrow();
$dateTime = $request->dateTime;
if (false == empty($dateTime)) {
$startTime = XDateTime::valueOf($dateTime);
$endTime = $startTime->addDay(1);
}
$response->dateTime = $startTime->getDateTime($startTime);
$list = DAL::get()->queryCountGroupByTeleProvider('TeleConversation', $request->queueId, $request->direction, $startTime, $endTime);
$telephoneAccount = $list['allcnt'] - $list['cmcc'] - $list['unicom'] - $list['telecom'];
$response->cmccAccount = empty($list['cmcc']) ? 0 : $list['cmcc'];
$response->unicomAccount = empty($list['unicom']) ? 0 : $list['unicom'];
$response->telecomAccount = empty($list['telecom']) ? 0 : $list['telecom'];
$response->telephoneAccount = empty($telephoneAccount) ? 0 : $telephoneAccount;
$response->cmccPercent = round($response->cmccAccount / $list['allcnt'], 2) * 100 . '%';
$response->unicomPercent = round($response->unicomAccount / $list['allcnt'], 2) * 100 . '%';
$response->telecomPercent = round($response->telecomAccount / $list['allcnt'], 2) * 100 . '%';
$response->telephonePercent = round($response->telephoneAccount / $list['allcnt'], 2) * 100 . '%';
}
示例15: intentionrecordList
public function intentionrecordList($request, $response)
{
/*{{{*/
$request->convertToGbk();
$fromDate = $request->fromDate;
$toDate = $request->toDate;
$inspectorUserName = $request->inspectorUserName;
$inspectorList = DAL::get()->find_all_by_realname('Inspector', $inspectorUserName);
$fromDate = empty($fromDate) ? XDateTime::today() : XDateTime::valueOf($fromDate)->toStringByFormat('Y-m-d H:i:s');
$toDate = empty($toDate) ? XDateTime::today()->toStringByFormat('Y-m-d 23:59:59') : XDateTime::valueOf($toDate)->toStringByFormat('Y-m-d 23:59:59');
$nowPage = $request->nowPage ? $request->nowPage : 1;
$pageSize = 50;
if (empty($inspectorList) && false == empty($inspectorUserName)) {
$response->intentionRecordList = array();
} else {
$res = IntentionClient::getInstance()->getIntentionRecordList(array_keys($inspectorList), $fromDate, $toDate, $nowPage, $pageSize);
$response->intentionRecordList = $res['intentionRecordList'];
$response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("/intention/intentionrecordlist?inspectorUserName=" . $response->inspectorUserName . "&fromDate=" . $response->fromDate . "&toDate=" . $response->toDate . "&nowPage="), $nowPage, $pageSize, $res['pageInfo']['total']);
}
$response->inspectorUserName = $inspectorUserName;
$response->fromDate = XDateTime::valueOf($fromDate)->toShortString();
$response->toDate = XDateTime::valueOf($toDate)->toShortString();
}