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


PHP XDateTime::valueof方法代码示例

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


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

示例1: ajaxCheckForm

 public function ajaxCheckForm($request, $response)
 {
     /*{{{*/
     $vars = $request->vars;
     //        $adwordId = $vars['adwordId'];
     $_cnt = 1;
     $adObjectList = $this->getAdObjectList($request, $response);
     $startTime = $vars['startTime'] . " " . $vars['startTimeHour'] . ":" . $vars['startTimeMinute'] . ":00";
     $endTime = $vars['endTime'] . " " . $vars['endTimeHour'] . ":" . $vars['endTimeMinute'] . ":00";
     $startTime = XDateTime::valueof($startTime);
     $endTime = XDateTime::valueof($endTime);
     if ($startTime <= XDateTime::now() && XDateTime::now() <= $endTime) {
         foreach ($adObjectList as $key => $ret) {
             foreach ($ret['adPlaceIds'] as $adplaceId) {
             }
             foreach ($ret['objectIds'] as $objectId) {
                 $res = DAL::get()->find_all_by_adplaceid_and_objectid('adword', $adplaceId, $objectId);
                 foreach ($res as $adword) {
                     if ($adword->isOnline()) {
                         $_cnt++;
                         if ($_cnt == 2) {
                             $adplaceStr = $adword->getAdWordPlace();
                             echo $adplaceStr;
                             return parent::DIRECT_OUTPUT;
                         }
                     }
                 }
             }
         }
     }
     echo "success";
     return parent::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:33,代码来源:adwordcontroller.php

示例2: mobile

 public function mobile($request, $response)
 {
     /*{{{*/
     $response->objects = $response->orderCntList = array();
     $today = XDateTime::now();
     if ($request->today) {
         $today = XDateTime::valueof($request->today);
     }
     $response->today = $today;
     $options['startTime'] = $today->toShortString();
     $options['endTime'] = $today->addDay(1)->toShortString();
     $options['status'] = $request->getRequest('status', PresentOrder::STATUS_PAID_YES);
     $groupBy = 'spaceid';
     $response->status = $options['status'];
     $orderCntList = PresentClient::getInstance()->getCntsInPresentOrder($groupBy, $options);
     $list = array();
     $allAmount = $allCnt = 0;
     $response->sortType = $request->getRequest('sortType', 'cnt');
     if ($orderCntList) {
         foreach ($orderCntList as $key => $ordersCnt) {
             $list[$key]['id'] = $key;
             $list[$key]['cnt'] = $ordersCnt['cnt'];
             $list[$key]['amount'] = $ordersCnt['amount'];
             $allAmount += $ordersCnt['amount'];
             $allCnt += $ordersCnt['cnt'];
         }
         XString::sortArray($list, $response->sortType);
         $response->orderCntList = $list;
         $objectIds = array_keys($orderCntList);
         $response->objects = DAL::get()->find('space', $objectIds);
     }
     $response->allAmount = $allAmount;
     $response->allCnt = $allCnt;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:34,代码来源:presentcontroller.php

示例3: initTime

<div style="float:left;">
<div class="reveiwNotice-box f14" id="screenDiv" style="border:none;"> 
<form action="" method="post" id="save_checkupreport_form" >

发生时间:
<?php 
$occurTime = $checkupReport->occurTime;
$ctime = $checkupReport->ctime;
if ($occurTime == $ctime) {
    $dYear = 0;
    $dMonth = 0;
    $dDay = 0;
} else {
    $dYear = XDateTime::valueof($occurTime)->getYear();
    $dMonth = XDateTime::valueof($occurTime)->getMonth();
    $dDay = XDateTime::valueof($occurTime)->getDay();
}
?>
<SCRIPT LANGUAGE="JavaScript">
function initTime(year, month, day){
        inityear($("#dateyear"),year);
        initmonth($("#datemonth"),month);
        initday($("#dateday"),31,day);
}

$(function(){
	initTime(<?php 
echo $dYear;
?>
, <?php 
echo $dMonth;
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:31,代码来源:inputcheckupreport.php


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