コード例 #1
0
ファイル: RcController.php プロジェクト: lovecheng/brs-demo2
 /**
  * 25获取bos端的订单列表 [bos]
  * url:/index.php?r=CarrentalApi/rc/GetCarRentalOrderList
  */
 public function actionGetCarRentalOrderList()
 {
     $json_params = Yii::app()->request->getParam('json_params');
     //客户端请求的json参数
     //测试用例[S]
     $json_params_go = Yii::app()->request->getParam('go');
     if ($json_params_go == 'go') {
         $array_params['UserId'] = 3121212;
         $array_params['DateFrom'] = "2014-10-27";
         $array_params['DateTo'] = '2014-12-12';
         $json_params = json_encode($array_params);
     }
     //测试用例[E]
     if (!empty($json_params) && IconvEncode::IsJson($json_params)) {
         $bos_rs_json = RcManager::GetCarRentalOrderList($json_params);
         if (!empty($bos_rs_json->GetCarRentalOrderListResult)) {
             $rs_bos_arr = json_decode($bos_rs_json->GetCarRentalOrderListResult, true);
             if ($rs_bos_arr['ErrorCode'] === 0 && !empty($rs_bos_arr['Response']['Response'])) {
                 $rs_bos_arr_response = json_decode($rs_bos_arr['Response']['Response'], true);
                 $return_json = json_encode(array('status' => true, 'data' => $rs_bos_arr_response));
                 exit($return_json);
             } else {
                 if (!empty($rs_bos_arr['ErrorMsg'])) {
                     $return_json = json_encode(array('status' => false, 'error_msg' => '0x250001_' . $rs_bos_arr['ErrorMsg']));
                     exit($return_json);
                 }
             }
         }
         $return_json = json_encode(array('status' => false, 'error_msg' => '0x250002_bos接口返回数据异常!' . json_encode($bos_rs_json)));
     } else {
         $return_json = json_encode(array('status' => false, 'error_msg' => '0x250003_传入的json格式用误!'));
     }
     exit($return_json);
 }