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; }
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; }