本文整理匯總了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();
}