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


PHP ExceptionHandler::Response方法代码示例

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


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

示例1: get_ProvinceCityList

 public function get_ProvinceCityList()
 {
     try {
         $List = array();
         //{"name":"\u5317\u4eac","citys":[{"10001":"\u5317\u4eac"}]},
         $City = array();
         $District = array();
         $District[] = array('100001' => '海淀');
         $District[] = array('100002' => '朝阳');
         $City[] = array('100000' => '北京', 'District' => $District);
         $Province = array('Province' => '北京', 'City' => $City);
         $List[] = $Province;
         $City = array();
         $District = array();
         $District[] = array('200001' => '越秀区');
         $District[] = array('200002' => '天河区');
         $City[] = array('200000' => '广州', 'District' => $District);
         $District = array();
         $District[] = array('200011' => '南山区');
         $District[] = array('200022' => '福田区');
         //$City = array();
         $City[] = array('200010' => '深圳', 'District' => $District);
         $Province = array('Province' => '广东', 'City' => $City);
         $List[] = $Province;
         /*
         $List = array();
         $List[] = array('ProvinceName' => '北京', 'CityName' => array(array('100001' => 'Haidian', '100002' => 'Chaoyang')));
         $List[] = array('ProvinceName' => 'HaiNan', 'CityName' => array(array('200001' => 'Haikou', '200002' => 'Sanya')));
         $List[] = array('ProvinceName' => 'Guangdong', 'CityName' => array(array('300001' => 'Guangzhou', '300002' => 'Shenzhen')));
         */
         //$List[] = array('HaiNan' => array('Haikou', 'Sanya'));
         //$List[] = array('Guangdong' => array('Guangzhou', 'Shenzhen'));
         $requestBody = array("Count" => 2, "List" => $List);
         return json_encode($requestBody);
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:38,代码来源:Common.php

示例2: getConsumerFavoriteCount

 public function getConsumerFavoriteCount($ConsumerId)
 {
     try {
         $OrderCount = R::getRow('SELECT COUNT(id) AS totalCount FROM consumerfavoriteproduct WHERE consumerid=?', [$ConsumerId]);
         echo ResponseJsonHandler::normalizeJsonResponse($OrderCount);
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:9,代码来源:Favorite.php

示例3: verifySmsCode

 public function verifySmsCode($SmsCodeId, $UserSmsCode, $Telephone)
 {
     try {
         $producer = R::getRow('SELECT id FROM producersmscode WHERE id=? AND code=? AND telephone=?', array($SmsCodeId, $UserSmsCode, $Telephone));
         if (!isset($producer) || empty($producer)) {
             throw new RecordNotFoundException("SMS code is incorrect, SmsCodeId:" . $SmsCodeId);
         }
         //expirationtime > NOW()
         $producer = R::getRow('SELECT id FROM producersmscode WHERE id=? AND code=? AND telephone=? AND expirationtime > NOW()', array($SmsCodeId, $UserSmsCode, $Telephone));
         if (!isset($producer) || empty($producer)) {
             throw new SmsException("SMS expired.");
         }
         echo json_encode(array("msg" => "success"));
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:17,代码来源:Producer.php

示例4: get_Images

 public function get_Images($ProductId)
 {
     try {
         /*$product = R::find('product', 'ProductId=?', array($ProductId));
         		echo json_encode(R::exportAll($product));*/
         $records = R::getAll('SELECT id, description, bigportraiturl, smallportraiturl FROM productimage WHERE productid=?', array($ProductId));
         if (!isset($records) || empty($records)) {
             throw new RecordNotFoundException("Record not found, id:" . $ProductId);
         }
         /*$Count = count($records);
         		$OrderList = array();
         		foreach ($records as $record)
         		{
         			$List[] = array('Id' => $record['id'], 'description' => $record['description'], 'bigportraiturl' => $record['bigportraiturl'], 'smallportraiturl' => $record['smallportraiturl']);
         		}
         		sendSuccess(array(
         			'Count'     => $Count,
         			'List' => $List,
         		));*/
         $response = new ResponseJSON(["id", "description", "bigportraiturl", "smallportraiturl"]);
         foreach ($records as $record) {
             $response->appendData($record);
         }
         //print json_encode($response2->exportResponse())."\n";
         echo $response->exportResponse() . "\n";
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:29,代码来源:Product.php

示例5: delete_Consignee

 public function delete_Consignee($ConsigneeId)
 {
     try {
         $record = R::findOne('consignee', 'id=?', array($ConsigneeId));
         if (!isset($record) || empty($record)) {
             throw new RecordNotFoundException("Record not found, id:" . $ConsigneeId);
         }
         R::trash($record);
     } catch (Exception $ex) {
         return ExceptionHandler::Response($ex, $this->_app);
     }
 }
开发者ID:WTer,项目名称:NJB,代码行数:12,代码来源:Order.php


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