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


PHP XDateTime類代碼示例

本文整理匯總了PHP中XDateTime的典型用法代碼示例。如果您正苦於以下問題:PHP XDateTime類的具體用法?PHP XDateTime怎麽用?PHP XDateTime使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了XDateTime類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: soapServer

 public function soapServer($request, $response)
 {/*{{{*/
     $postdata = file_get_contents("php://input");
     $function = 'soapServer';
     $this->ioLogRecorder->addLog(XDateTime::now()->toString()." service [{$function}] ".$this->ioLogRecorder->format2SimpleLog($postdata));
     $configs = ProviderConfigFactory::getProviderAppConfigs(PhoneConference::SPTYPE_HUAWEI, TeleConfProvider::APPTYPE_CONF);
     $callbackUrl = $configs['callbackUrl'];
     $server = new SoapServer(null, array('uri' => 'HuaweiConfCallback','location'=>$callbackUrl));
     $server->setClass('HuaweiTeleConfApi');
     try
     {
         $lockName = $this->getLockerName($postdata);
         $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER);
         $locker  = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher));
         $locker->getLock($lockName);
         $server->handle();
         $locker->releaseLock($lockName);
     }
     catch(Exception $ex)
     {
         $locker->releaseLock($lockName);
     }
     header("HTTP/1.1 202 Accepted");
     header("Content-Type: text/xml;charset=UTF-8");
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:26,代碼來源:huaweiconfcallbackcontroller.php

示例2: doSuggestion

   public function doSuggestion($request, $response)
   {/*{{{*/
       $suggestion = iconv("utf8", "gbk", $request->suggestion);
       $contactInfo = iconv("utf8", "gbk", $request->contactInfo);
       if ($suggestion == '' || $suggestion == '請填寫您在使用中遇到的問題(目前暫時不提供疾病谘詢服務)')
       {
            echo '{"res":"failure", "msg":"請填寫您在使用中遇到的問題!"}';
            return self::DIRECT_OUTPUT;
       }
       if ($contactInfo == '' || $contactInfo == '手機或郵箱')
       {
            echo '{"res":"failure", "msg":"請填寫您的聯係方式!"}';
            return self::DIRECT_OUTPUT;
       }
       $from = $request->from;

       $content = "來自 ".$from." 的用戶(觸屏版)發送了一條意見或建議, 內容如下:\n";
       $content .= "----------------------------------------------------------------------------\n";
       $content .= $suggestion."\n\n";
       $content .= "聯係方式: $contactInfo\n";
       $content .= "----------------------------------------------------------------------------\n";
       $content .= XDateTime::now()->toString();
       $userId = 0;
       $result = UserClient::getInstance()->addUserAdvice('意見建議', $content, $userId);
       if ($result)
       {
            echo '{"res":"success"}';
        }
        else
        {
            echo '{"res":"failure", "msg":"對不起,信息提交失敗!"}';
        }
        return self::DIRECT_OUTPUT;
   }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:34,代碼來源:suggestioncontroller.php

示例3: add

 public function add($request, $response)
 {
     $diseaseId = $request->diseaseId;
     $params = $request->vars;
     $params['isVoteSelf'] = $request->isVoteSelf;
     if ($vars[threadCategoryId] < 0) {
         unset($vars[threadCategoryId]);
     }
     if (empty($diseaseId)) {
         $key = isset($params['key']) ? $params['key'] : '';
         $name = isset($params['name']) ? $params['name'] : '';
         $diseaseId = DiseaseClient::getInstance()->addDisease($key, $name, $params);
     } else {
         $diseaseId = DiseaseClient::getInstance()->modifyDisease($diseaseId, $params);
         $disease = DAL::get()->find('disease', $diseaseId);
         error_log($response->curOperatorUser->name . ' ' . XDateTime::now() . ' 修改疾病' . $disease->name . ' 的父疾病 為' . $params['parentName'] . "\n\n", 3, '/tmp/modifyparentdisease.log');
         $re_symptom = $request->getRequest('re_symptom', '');
         $re_search_word = $request->getRequest('re_search_word', '');
         $re_location = $request->getRequest('re_location', '');
         $stringList = array(DiseaseRelation::TYPE_SYMPTOM => $re_symptom, DiseaseRelation::TYPE_LOCATION => $re_location);
         DiseaseClient::getInstance()->updateStringRelation($disease->id, array_keys($stringList), $stringList);
     }
     $disease = DAL::get()->find('disease', $diseaseId);
     if ($disease->isNull() == false) {
         Squid::clean($disease->getUrl());
     }
     $msg = urlencode('操作成功');
     $response->setRedirect('/disease/detail?id=' . $diseaseId . '&msg=' . $msg);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:29,代碼來源:diseasecontroller.php

示例4: service

 public function service($request, $response)
 {/*{{{*/
     ob_start();
     $result = "";
     $function = $request->service;
     if(method_exists($this, $function))
     {
         try
         {
             $lockName = $this->getLockerName($request);
             $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER);
             $locker  = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher));
             $locker->getLock($lockName);
             $result = $this->$function($request,$response);
             $locker->releaseLock($lockName);
         }
         catch(LockException $ex)
         {
             $this->ioLogRecorder->addLog(XDateTime::now()->toString()."並發鎖錯誤 $lockName\n");
         }
         catch(Exception $ex)
         {
             $locker->releaseLock($lockName);
         }
     }
     echo $result;
     header('Content-Length: ' . ob_get_length());
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:29,代碼來源:teleconfcallbackcontroller.php

示例5: service

    public function service($request, $response)
    {/*{{{*/
        ob_start();
        $result = $this->callCenterApi->responseCmdNone();
        $function = $this->returnFunction($request);

        if(method_exists($this, $function))
        {
            try
            {
                $lockName = $this->getLockerName($request);
                $cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER);
                $locker  = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher));
                $locker->getLock($lockName);
                $result = $this->$function($request,$response);
                $locker->releaseLock($lockName);
            }
            catch(LockException $ex)
            {
                $this->logTxt .= XDateTime::now()->toString()." 並發鎖錯誤 $lockName\n";
            }
            catch(Exception $ex)
            {
                $this->logTxt .= XDateTime::now()->toString()." 釋放鎖 $lockName\n";
                $locker->releaseLock($lockName);
            }
        }

        echo $result;
        $this->logTxt .= XDateTime::now()->toString().'--->'.print_r($result, true)."\n";
        header('Content-Length: ' . ob_get_length());
        return parent::DIRECT_OUTPUT;
    }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:33,代碼來源:callcentercallbackcontroller.php

示例6: addIncidentPost

 public function addIncidentPost($request, $response)
 {
     $followupCustomerId = $request->followupCustomerId;
     $params = $request->arr;
     $vars = $request->vars;
     $incident = DAL::get()->find_by_title_and_followupcustomerid('Incident', $params['title'], $followupCustomerId);
     if ($incident instanceof Incident) {
         throw new BizException('事件名稱已存在!');
     }
     $incidentId = IncidentClient::getInstance()->addIncident($followupCustomerId, $params['title'], $params['firstTime'], $params);
     $incident = DAL::get()->find('Incident', $incidentId);
     $followupCustomer = DAL::get()->find('FollowupCustomer', $followupCustomerId);
     $model = DAL::get()->find_by_title('NfsTaskModel', '症狀事件');
     $model = array($model);
     $incident = DAL::get()->find('Incident', $incidentId);
     $user = $followupCustomer->getBindUser();
     $assigner = $this->auditor;
     $deadline = XDateTime::tomorrow();
     $taskDesc = "新建症狀事件任務";
     $roleId = 825967283;
     //醫助的角色id
     $taskId = TaskClient::getInstance()->addTask($model, $incident, $followupCustomer->space, $user, $assigner, $deadline, $taskDesc, $roleId);
     $this->addIncidentStatePostImp($incident, $vars);
     $preMsg = "{$incidentId} 添加成功";
     $response->setRedirect($response->router->urlfor('incident/incidentsofcustomer', array('followupCustomerId' => $followupCustomerId, 'preMsg' => $preMsg)));
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:26,代碼來源:incidentcontroller.php

示例7: 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

示例8: updateBaseInfo

	public function updateBaseInfo($request, $response)
	{
		$vars = $request->var;
		if ($request->is_ajax) {
			$vars = XString::toGbkDeep($vars);
		}
		if (!empty($vars['birthday']))
			$vars['birthday'] = XDateTime::valueOf($vars['birthday']);
		DoctorClient::getInstance()->modifyByDoctor($this->_newSpace->host->id, $vars);
		
		//調用同步新浪微博接口(更新醫生個人信息和修改醫生資料)
		//MessageQueueClient::getInstance()->regEvent(new UpdateDoctorInformationSinaWeiboEvent($this->_newSpace->user->id));
		if ($request->is_ajax)
		{
			$results = array(
				'grade' => XString::convertToUnicode($this->_newSpace->host->grade),
				'educate_grade' => XString::convertToUnicode($this->_newSpace->host->educateGrade),
				'specialize' => XString::convertToUnicode($this->_newSpace->host->specialize),
				'intro' => XString::convertToUnicode(XString::truncate($this->_newSpace->host->intro, 100)),
				'status' => 0,
			);
			echo json_encode($results);
			exit;
		}
        $this->message('您的醫生資料提交成功!將在1個工作日內審核後生效!', $response, array(
            'buttons' => array(
                array('text' => '繼續修改', 'url' => $this->_newSpace->getUrl()."admindoctor/showbaseinfo"),
                array('text' => '進入個人網站', 'url' => $this->_newSpace->getUrl())
            ),
        ));
	
	}
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:32,代碼來源:admindoctorcontroller.php

示例9: 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);
	}/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:34,代碼來源:adminarticlecontroller.php

示例10: postSuggestion

   public function postSuggestion($request, $response)
   {/*{{{*/
       $suggestion = $request->suggestion;
       if(!$suggestion)  
       {                                           
           return false;                           
       }                                           
       if(strlen($suggestion)<=1)
       {
           $this->message("輸入信息過少, 請重新輸入!", $response);
           return false;
       }
       $tel = $request->tel;
       $email = $request->email;
       $name = $request->userName;

       $content = "來自 ".$_SERVER['REMOTE_ADDR']." 的用戶發送了一條意見或建議, 內容如下:\n";
       $content .= "----------------------------------------------------------------------------\n";
       $content .= $suggestion."\n\n";
       $content .= "電話: $tel\n";
       $content .= "E-Mail: $email\n";
       $content .= "姓名: $name\n";
       $content .= "----------------------------------------------------------------------------\n";
       $content .= XDateTime::now()->toString();
       $userId = $request->userid;
       $result = UserClient::getInstance()->addUserAdvice('意見建議', $content, $userId);
       $this->message("信息發送成功, 感謝您對好大夫網站的支持!", $response);
       return false;
   }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:29,代碼來源:suggestioncontroller.php

示例11: ajaxSaveLog

 /**
  * ajaxSaveLog 
  * @brief 記錄voip呼入呼出日誌 
  * @author kxy 
  * @version branches/v2.17.3
  * @date 2013-11-19
  */
 public function ajaxSaveLog($request, $response)
 {
     /*{{{*/
     $request->convertToGbk();
     $logStr = XDateTime::now()->toString() . "  座席:" . $this->curOperator->workId . "\n" . print_r($request->voipLog, true) . "\n";
     error_log($logStr, 3, $this->getLogFileName());
     return parent::DIRECT_OUTPUT;
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:15,代碼來源:voipcontroller.php

示例12: 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}";
     }
 }/*}}}*/
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:8,代碼來源:schemetask.php

示例13: getPayItemList

 public function getPayItemList($pageNo, $pageSize, $startTime, $endTime)
 {
     /*{{{*/
     DBC::requireTrue(XDateTime::getSecondDiffDesc($endTime, $startTime) < 3600, "查詢時間不能超過一天");
     $parameter = array("service" => "account.page.query", "partner" => $this->partner, "_input_charset" => $this->_input_charset, "page_no" => $pageNo, "page_size" => $pageSize, "gmt_start_time" => $startTime, "gmt_end_time" => $endTime, "logon_id" => "", "trade_no" => "", "merchant_out_order_no" => "", "deposit_bank_no" => "", "trans_code" => "");
     $alipay = new alipay_service($parameter, $this->security_code, $this->sign_type);
     $url = $alipay->create_url();
     return $url;
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:9,代碼來源:alipay.php

示例14: modifyDotimePost

 public function modifyDotimePost($request, $response)
 {
     /*{{{*/
     $projectInterviewId = $request->projectInterviewId;
     $projectInterview = DAL::get()->find('ProjectInterview', $projectInterviewId);
     DBC::requireTrue($projectInterview instanceof ProjectInterview, "ProjectInterview {$projectInterviewId} 不存在");
     ProjectInterviewClient::getInstance()->modifyDotime($projectInterviewId, XDateTime::now());
     $preMsg = "啟動本次訪視";
     $response->setRedirect("/projectanswersheetmgr/listofprojectinterview?projectInterviewId=" . $projectInterviewId . "&preMsg=" . $preMsg);
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:10,代碼來源:projectinterviewmgrcontroller.php

示例15: sendVerificationCodeEmail

 public function sendVerificationCodeEmail($request, $response)
 {
     /*{{{*/
     if (false == RequestDelegate::isOfficeIp()) {
         echo '係統錯誤,請聯係技術人員!!!';
         exit;
     }
     PrivilegeClient::getInstance()->sendVerificationCodeEmail($request->emailaddress, XDateTime::valueOf($request->starttime), XDateTime::valueOf($request->endtime));
     $response->setRedirect($response->router->urlfor('backyardauth/applytoken?st=ok'));
 }
開發者ID:sdgdsffdsfff,項目名稱:hdf-client,代碼行數:10,代碼來源:backyardauthcontroller.php


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