Beispiel #1
0
 public function handle_request_internal()
 {
     //        @params proids :房源id 多个id以逗号间隔如22,33,44【必填】
     //        @params brokerId :经纪人id【必填】
     //        @params token :token【必填】
     //        @params from :请求来源【必填】
     $paramsApi['from'] = APF::get_instance()->get_config('java_api_from');
     $paramsApi['proids'] = $this->_params['propIds'];
     $paramsApi['token'] = $this->_params['token'];
     $paramsApi['brokerId'] = $this->_params['brokerId'];
     $brokerId = $this->_params['brokerId'];
     //判断经纪人为ppc经纪人 & 套餐经纪人
     //根据不同类型判断调用不同的java接口
     if (Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         $paramsApi['isComboBroker'] = true;
         $api_url = 'sale/properties/deletes?json';
     } else {
         $paramsApi['isComboBroker'] = false;
         $api_url = 'ppc/properties/deletes?json';
     }
     $data = Util_CallAPI::callJavaInternalApi($api_url, $paramsApi, false);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => array());
     } else {
         $errcode = $data['data']['code'];
         $translate_errcode = $this->my_err_code($errcode);
         return Util_MobileAPI::error($translate_errcode);
     }
     return $ret;
 }
Beispiel #2
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     //检测title
     $checkRes = $this->checkTitle($this->_params);
     if (!$checkRes) {
         return Util_MobileAPI::error(Const_APIStatus::E_PROP_LENGTH_ERROE);
     }
     //构造房源接口数据
     $params = Bll_Prop::gen_prop_info($this->_params);
     $params['proid'] = $this->_params['propId'];
     if (isset($params['status']) and $params['status'] === 'error') {
         return $params;
     }
     //判断经纪人为ppc经纪人 & 套餐经纪人
     //根据不同类型判断调用不同的java接口
     if (Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         $params['isComboBroker'] = true;
         $api_url = 'sale/properties/update?json';
     } else {
         $params['isComboBroker'] = false;
         $api_url = 'ppc/properties/update?json';
     }
     //调用房源编辑接口
     $result = Util_CallAPI::callJavaInternalApi($api_url, $params, false);
     if ($result['data']['status'] !== 'ok') {
         return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($result['data']['code']));
     }
     $return = array();
     $return["status"] = "ok";
     $return['data'] = array();
     return $return;
 }
Beispiel #3
0
 public function handle_request_internal()
 {
     if (mb_strlen($this->_params['title'], 'UTF-8') < 5 || mb_strlen($this->_params['title'], 'UTF-8') > 30) {
         return Util_MobileAPI::error(Const_APIStatus::E_PROP_LENGTH_ERROE);
     }
     $params = Bll_ZuProp::gen_prop_info($this->_params);
     $params['proid'] = $this->_params['propId'];
     //unset($params['style']);
     //获取租房房信息
     /*$propInfo       =  Bll_HzProp::get_prop($this->_params['propId']);
       $style = intval($propInfo['protype']) ? intval($propInfo['protype']) : 1;
       $change_style   = array(1=>1, 4=>2, 3=>3, 5=>4, 2=>5, 6=>6, 7=>7, 8=>8);
       $params['style'] = $change_style[$style];*/
     unset($params['year']);
     if (isset($params['status']) and $params['status'] === 'error') {
         return $params;
     }
     $brokerId = $this->_params['brokerId'];
     if (isset($brokerId) && Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         $params['isComboBroker'] = true;
         $api_url = 'rent/properties/update?json=1';
     } else {
         $params['isServiceInternal'] = 1;
         $params['isComboBroker'] = false;
         $api_url = '/service-internal/rest/properties/update?json=1';
     }
     $result = Util_CallAPI::callJavaInternalApi($api_url, $params, false);
     if ($result['data']['status'] !== 'ok') {
         return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($result['data']['code']));
     }
     $return = array();
     $return["status"] = "ok";
     $return['data'] = array();
     return $return;
 }
Beispiel #4
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $propIds = $this->_params['propIds'];
     $cityId = $this->_params['cityId'];
     $paramsApi['from'] = APF::get_instance()->get_config('java_api_from');
     $paramsApi['proids'] = $propIds;
     $paramsApi['proid'] = $propIds;
     $paramsApi['token'] = $this->_params['token'];
     $paramsApi['brokerId'] = $brokerId;
     $paramsApi['tradeType'] = 2;
     if (Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         $paramsApi['isComboBroker'] = true;
         $api_url = 'rent/properties/deletes?json';
         $data = Util_CallAPI::callJavaInternalApi($api_url, $paramsApi, false);
         if ($data['data']['status'] === 'ok') {
             $ret = array('status' => 'ok', 'data' => array());
         } else {
             $ret = Util_MobileAPI::error(Const_APIStatus::E_PROP_DEL_FAILED);
         }
         return $ret;
     } else {
         $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($brokerId);
         $ret = Bll_HzProp::delete_prop($brokerId_hz, $cityId, $propIds);
         if ($ret) {
             $return = array('status' => 'ok', 'data' => array());
         } else {
             $return = Util_MobileAPI::error(Const_APIStatus::E_PROP_DEL_FAILED);
         }
         return $return;
     }
 }
Beispiel #5
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $cityId = $this->_params['cityId'];
     $ownerPropId = $this->_params['ownerPropId'];
     //检测title
     $checkRes = $this->checkTitle($this->_params);
     if (!$checkRes) {
         return Util_MobileAPI::error(Const_APIStatus::E_PROP_LENGTH_ERROE);
     }
     //构造房源接口数据
     $params = Bll_Prop::gen_prop_info($this->_params);
     if (isset($params['status']) and $params['status'] === 'error') {
         return $params;
     }
     //判断经纪人为ppc经纪人 & 套餐经纪人
     //根据不同类型判断调用不同的java接口
     $api_url = 'sale/properties/add?json';
     //调用房源发布接口
     $result = Util_CallAPI::callJavaInternalApi($api_url, $params, false);
     if ($result['data']['status'] != 'ok') {
         return Util_MobileAPI::error_tmp($result['data']['code'], $result['data']['info']);
     }
     $imageJson = (array) json_decode($this->_params['imageJson']);
     if ($imageJson) {
         $proid = $result['data']['action']['proid'];
         foreach ($imageJson as $img) {
             $api_url = 'image/addImg';
             $img_params['brokerId'] = $brokerId;
             $img_params['propId'] = $proid;
             $img_params['imageJson'] = json_encode($img);
             $img_params['from'] = APF::get_instance()->get_config('java_api_from');
             $img_params["token"] = $this->_params["token"];
             //token
             ksort($img_params);
             $img_params_json = json_encode($img_params);
             $img_return = Util_CallAPI::get_data_from_java_v3($api_url, $img_params_json, false);
             if ($img_return['data']['status'] != 'ok' && !$img_return['data']['id']) {
                 return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($img_return['data']['code']));
             }
         }
     }
     $return = array();
     $return["status"] = "ok";
     $return['data']['id'] = $proid = $result['data']['action']['proid'];
     if ($proid && isset($ownerPropId) && !empty($ownerPropId)) {
         //委托房源回写
         $entrustDynamicLog = new V1_Entrust_PropertyDynamicLogController();
         $entrustDynamicLog->addLog($cityId, $ownerPropId, $brokerId, $proid, 2, 2);
     }
     return $return;
 }
Beispiel #6
0
 public function handle_request_internal()
 {
     header("Content-type:text/html;charset=utf-8");
     if (mb_strlen($this->_params['title'], 'UTF-8') < 5 || mb_strlen($this->_params['title'], 'UTF-8') > 30) {
         return Util_MobileAPI::error(Const_APIStatus::E_PROP_LENGTH_ERROE);
     }
     $params = Bll_ZuProp::gen_prop_info($this->_params);
     if (isset($params['status']) and $params['status'] === 'error') {
         return $params;
     }
     //$api_url = '/service-ppc/rest/ppc/properties/add';
     $brokerId = $this->_params['brokerId'];
     $api_url = 'rent/properties/add?json=1';
     $result = Util_CallAPI::callJavaInternalApi($api_url, $params, false);
     if ($result['data']['status'] != 'ok') {
         return Util_MobileAPI::error_tmp($result['data']['code'], $result['data']['info']);
     }
     $imageJson = (array) json_decode($this->_params['imageJson']);
     $proid = $result['data']['id'];
     if (empty($proid)) {
         $proid = $result['data']['action']['proid'];
     }
     if ($imageJson) {
         foreach ($imageJson as $img) {
             $api_url = 'image/addImg';
             $img_params['brokerId'] = $brokerId;
             $img_params['propId'] = $proid;
             //type:1-室内图  2-房型图 3-小区图
             $img_params['imageJson'] = json_encode($img);
             $img_params['from'] = APF::get_instance()->get_config('java_api_from');
             $img_params["token"] = $this->_params["token"];
             //token
             ksort($img_params);
             $img_params_json = json_encode($img_params);
             $img_return = Util_CallAPI::get_data_from_java_v3($api_url, $img_params_json, false);
             if ($img_return['data']['status'] != 'ok' && !$img_return['data']['id']) {
                 return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($img_return['data']['code']));
             }
         }
     }
     $return = array();
     $return["status"] = "ok";
     $return['data']['id'] = $proid;
     return $return;
 }