Пример #1
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;
 }
Пример #2
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $url = 'haopan/unRecommendProp/' . $brokerId . '/1';
     $data = Util_CallAPI::get_data_from_java_v3($url);
     mb_internal_encoding('UTF-8');
     if ($data['data']['status'] === 'ok') {
         if (!isset($data['data']['propBaseInfo'])) {
             $ret = array('status' => 'ok', 'data' => array('propertyList' => array()));
             return $ret;
         }
         $props = array();
         if (!empty($data['data']['propBaseInfo'])) {
             foreach ($data['data']['propBaseInfo'] as $info) {
                 list($room, $hall, $wc) = $this->get_house_unit($info['housUnits']);
                 $propInfo = Bll_Prop::get_ajk_prop_info($info['propId']);
                 $tmp = array('id' => $info['propId'], 'title' => $info['title'], 'commName' => $info['commName'], 'roomNum' => $room, 'hallNum' => $hall, 'toiletNum' => $wc, 'area' => $propInfo['AREANUM'], 'price' => $info['price'] / 10000, 'priceUnit' => '万', 'ImgNum' => $info['propImgNum'], 'isMoreImg' => $propInfo['ISHIGHQULITY']);
                 $props['propertyList'][] = $tmp;
             }
         }
         $ret = array('status' => 'ok', 'data' => $props);
     } else {
         $ret = Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR);
     }
     return $ret;
 }
Пример #3
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;
 }
Пример #4
0
 public function handle_request_internal()
 {
     if ($this->_params['offer']) {
         $post = array('brokerId' => $this->_params['brokerId'], 'budget' => $this->_params['budget'] * 100, 'offer' => $this->_params['offer'] * 100, 'propId' => $this->_params['propId']);
     }
     $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId']));
     if (!Bll_City::isBidCity($city_info['CITYID'])) {
         $error_code = Const_HzErrorInfo::NOBIDCITY;
         return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code));
     }
     if (!empty($this->_params['offer'])) {
         $offerStr = (string) $this->_params['offer'];
         if (strpos($offerStr, ".") !== false) {
             $offerArr = explode('.', $offerStr);
             if (strlen($offerArr[1]) > 1) {
                 return Util_MobileAPI::error_tmp("3016", "竞价出价最小单位为角");
             }
         }
     }
     $api_url = '/service-ppc/rest/hp/createHPlan';
     $result = Util_CallAPI::get_data_from_java_api($api_url, $post);
     if ($result['data']['status'] == 'ok') {
         $return = array('status' => 'ok', 'data' => array());
     } else {
         $return = Util_MobileAPI::error(self::changeJavaAPICodeToSelfCode($result['data']['code']));
     }
     return $return;
 }
Пример #5
0
 public function handle_request_internal()
 {
     if (!isset($this->_params["propId"])) {
         return Util_MobileAPI::error(Const_APIStatus::E_PROP_ID_MISS);
     }
     $json = $this->_params['imageJson'];
     //$json = '[{"type":3,"commPicIds":12345}]';
     $imageJson = json_decode($json, true);
     if ($imageJson) {
         $proid = $this->_params["propId"];
         foreach ($imageJson as $img) {
             $api_url = 'image/addImg';
             $img_params['brokerId'] = $this->_params['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']));
             }
         }
     } else {
         return Util_MobileAPI::error(Const_APIStatus::E_PROP_IMAGEJSON_ERROR);
     }
     $return = array();
     $return["status"] = "ok";
     $return['data']['id'] = $img_return['data']['id'];
     return $return;
 }
Пример #6
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     if (empty($brokerId)) {
         return Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS);
     }
     $url = '/service-ppc/rest/ppc/getBrokerPpcPlans/' . $brokerId . '?tradeType=1&isNew=1';
     $data = Util_CallAPI::get_data_from_java_api($url);
     $ret = array('status' => 'ok', 'data' => array('planList' => array()));
     if ($data['data']['plan']) {
         $plan = array();
         foreach ($data['data']['plan'] as $planInfo) {
             if ($planInfo['statusDescrip'] == '推广中') {
                 $status = 1;
                 //推广中
             } else {
                 $status = 2;
                 //其它都是非推广
             }
             $tmp = array('fixPlanId' => $planInfo['id'], 'fixPlanName' => $planInfo['planName'], 'fixPlanPropCeiling' => $planInfo['ceiling'] / 100, 'fixPlanPropNum' => $planInfo['propSize'], 'fixPlanState' => $status, 'fixPlanStateDesc' => $planInfo['statusDescrip']);
             $plan['planList'][] = $tmp;
         }
         $ret = array('status' => 'ok', 'data' => $plan);
     }
     return $ret;
 }
Пример #7
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;
 }
Пример #8
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;
     }
 }
Пример #9
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $url = 'haopan/unRecommendProp/' . $brokerId . '/1';
     $data = Util_CallAPI::get_data_from_java_v3($url);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => array('total' => count($data['data']['propBaseInfo'])));
     }
     return $ret;
 }
Пример #10
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $url = 'haopan/brokerPlanReport/' . $brokerId . '/1';
     $data = Util_CallAPI::get_data_from_java_v3($url);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => $data['data']['bidPlan']);
     }
     return $ret;
 }
Пример #11
0
 /**
  * 获得计划的推广信息。
  * @param type $brokerId
  * @param type $planId
  * @return array
  */
 private function get_plan_status_info($brokerId, $planId)
 {
     $api_url = '/service-ppc/rest/ppc/planCost';
     $params['plan_id'] = $planId;
     $params['start_time'] = strtotime(date("Ymd"));
     $params['end_time'] = time();
     $params['type'] = 'daily';
     $status_info = Util_CallAPI::get_data_from_java_api($api_url, $params);
     return $status_info;
 }
Пример #12
0
 public static function sendPublicMsg($chatId, $msg)
 {
     $api_url = '/message/publicservice/sendMessage/101/1';
     $data = array('from_service_id' => 101, 'to_uid' => $chatId, 'msg_type' => 1, 'body' => $msg);
     try {
         $result = Util_CallAPI::get_data_from_chat_api($api_url, json_encode($data));
     } catch (Exception $e) {
         $result = false;
     }
     return $result;
 }
 public function handle_request_internal()
 {
     //组织数据
     if (!isset($this->_params["num"]) || $this->_params["num"] > 500) {
         return '图片数目不合法,1-500';
     }
     $_objAjkORM = new ORM_AnjukeORM('ajk_communitys');
     $comm_list = $_objAjkORM->getList('typeflag=0   limit 0,500', array(), true, true);
     //print_r($comm_list);die;
     $return_urls = array();
     $no = 0;
     foreach ($comm_list as $k => $comm) {
         $params['commId'] = $comm['COMMID'];
         $params['pageNo'] = 1;
         $params['pageSize'] = 20;
         $params['imgSize'] = '800x600';
         $params['rommNum'] = 2;
         $params['hallNum'] = 1;
         $params['toiletNum'] = 1;
         $params['forward'] = '南';
         $params['forward'] = urlencode($params['forward']);
         //通过java接口获取数据
         $api_url = "image/houseModuleImg/" . $params['commId'];
         $_params = array();
         foreach ($params as $key => $value) {
             $_params[] = "{$key}={$value}";
         }
         $api_url = $api_url . '?' . implode('&', $_params);
         $houseImg = Util_CallAPI::get_data_from_java_ga($api_url, '', false);
         //print_r($houseImg);die;
         if ($houseImg['data']['status'] == 'ok') {
             $houseImg = $houseImg['data'];
             if (!empty($houseImg['imgs'])) {
                 foreach ($houseImg['imgs'] as $k => $img) {
                     if ($no >= $this->_params["num"]) {
                         break 2;
                     }
                     $return_urls[] = $houseImg['imgs'][$k]['url'];
                     $no++;
                     // print_r($houseImg['imgs'][$k]['url']) . "\n";
                 }
             } else {
                 continue;
             }
             unset($houseImg['status']);
         } else {
             continue;
         }
     }
     $return = array();
     $return["status"] = "ok";
     $return['data'] = $return_urls;
     return $return;
 }
Пример #14
0
 public function handle_request_internal()
 {
     //根据图片ID删除该图片
     $this->_params['from'] = APF::get_instance()->get_config('java_api_from');
     $api_url = 'image/dels';
     $result = Util_CallAPI::get_data_from_java_v3($api_url, $this->_params, false);
     if ($result['data']['status'] != 'ok') {
         return Util_MobileAPI::error_tmp($result['data']['code'], $result['data']['info']);
     }
     $r = array('status' => 'ok', 'data' => array());
     return $r;
 }
Пример #15
0
 public function handle_request_internal()
 {
     $propId = $this->_params['propId'];
     $url = '/service-ppc/rest/hp/hplanOnlineInfo?propId=' . $propId;
     $data = Util_CallAPI::get_data_from_java_api($url);
     if ($data['http_code'] == 200) {
         $ret = array('status' => 'ok', 'data' => round($data['data']['planOnlineInfo']['minOffer'] / 100, 2));
     } else {
         $ret = Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']);
     }
     return $ret;
 }
Пример #16
0
 public function handle_request_internal()
 {
     $post = array('brokerId' => $this->_params["brokerId"], 'planId' => $this->_params["planId"], 'from' => APF::get_instance()->get_config('java_api_from'));
     $url = '/service-ppc/rest/ppc/pausePpc';
     $data = Util_CallAPI::get_data_from_java_api($url, $post);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => array());
     } else {
         return Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']);
     }
     return $ret;
 }
Пример #17
0
 public function handle_request_internal()
 {
     $planId = $this->_params['planId'];
     $url = '/service-ppc/rest/ppc/getPpcPlan/' . $planId . '?resType=0';
     $data = Util_CallAPI::get_data_from_java_api($url);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => array('ceiling' => $data['data']['plan']['ceiling']));
     } else {
         //@todo
     }
     return $ret;
 }
Пример #18
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;
 }
Пример #19
0
 public function handle_request_internal()
 {
     //组织数据
     if (!isset($this->_params["commId"])) {
         return Util_MobileAPI::error(Const_APIStatus::E_PARAM_COMMID_MISS);
     }
     if (isset($this->_params["rooms"])) {
         $rooms = explode(',', $this->_params["rooms"]);
         $rommNum = $rooms[0];
         $hallNum = $rooms[1];
         $toiletNum = $rooms[2];
     }
     $params['commId'] = $this->_params['commId'];
     $params['pageNo'] = isset($this->_params['pageNo']) ? trim($this->_params['pageNo']) : 1;
     $params['pageSize'] = isset($this->_params['pageSize']) ? trim($this->_params['pageSize']) : 10;
     $params['imgSize'] = isset($this->_params['imgSize']) ? trim($this->_params['imgSize']) : '420x315';
     $params['rommNum'] = $rommNum ? $rommNum : 2;
     $params['hallNum'] = $hallNum ? $hallNum : 1;
     $params['toiletNum'] = $toiletNum ? $toiletNum : 1;
     $params['forward'] = isset($this->_params['forward']) ? trim($this->_params['forward']) : '南';
     if (!in_array($params['forward'], array("东", "南", "西", "北", "南北", "东西", "东南", "西南", "东北", "西北"))) {
         $params['forward'] = '南';
     }
     $params['forward'] = urlencode($params['forward']);
     //通过java接口获取数据
     $api_url = "image/houseModuleImg/" . $params['commId'];
     $_params = array();
     foreach ($params as $key => $value) {
         $_params[] = "{$key}={$value}";
     }
     $api_url = $api_url . '?' . implode('&', $_params);
     $houseImg = Util_CallAPI::get_data_from_java_ga($api_url, '', false);
     if ($houseImg['data']['status'] == 'ok') {
         $houseImg = $houseImg['data'];
         if (!empty($houseImg['imgs'])) {
             foreach ($houseImg['imgs'] as $k => $img) {
                 $arr = explode('/', $img['fileName']);
                 $houseImg['imgs'][$k]['hash'] = $arr[1];
             }
         } else {
             $houseImg['imgs'] = array();
         }
         unset($houseImg['status']);
         unset($houseImg['count']);
     } else {
         return Util_MobileAPI::error(self::changeJavaAPICodeToSelfCode($houseImg['data']['code']));
     }
     $return = array();
     $return["status"] = "ok";
     $return['data']['houseImg'] = $houseImg;
     return $return;
 }
Пример #20
0
 public function handle_request_internal()
 {
     $planid = $this->_params['planid'];
     $url = '/service-ppc/rest/ppc/getPpcPlan/' . $planid . '?resType=1';
     $data = Util_CallAPI::get_data_from_java_api($url);
     if ($data) {
         unset($data['data']['status']);
         $ret = array('status' => 'ok', 'data' => $data['data']);
     } else {
         $ret = Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']);
     }
     return $ret;
 }
Пример #21
0
 public function handle_request_internal()
 {
     $post = array('brokerId' => $this->_params['brokerId'], 'proIds' => $this->_params['propId'], 'planId' => $this->_params['planId'], 'from' => APF::get_instance()->get_config('java_api_from'));
     $url = '/service-ppc/rest/ppc/planDelProperty';
     $data = Util_CallAPI::get_data_from_java_api($url, $post);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => array());
     } else {
         $errcode = $data['data']['code'];
         $translate_errcode = $this->my_err_code($errcode);
         $ret = Util_MobileAPI::error($translate_errcode);
     }
     return $ret;
 }
Пример #22
0
 public function handle_request_internal()
 {
     if (!isset($this->_params['cityId'])) {
         return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS);
     }
     $api_url = 'conf/publishPropConf?cityId=' . $this->_params['cityId'];
     $result = Util_CallAPI::get_data_from_java_v3($api_url);
     if ($result['data']['status'] !== 'ok') {
         return Util_MobileAPI::error(Bll_Prop::changeJavaAPICodeToSelfCode($result['data']['code']));
     }
     unset($result['data']['status']);
     $return = array();
     $return["status"] = "ok";
     $return['data'] = $result['data'];
     return $return;
 }
Пример #23
0
 public function handle_request_internal()
 {
     $router_matches = $this->_request->get_router_matches();
     //API说明
     if ($this->_params['doc'] == 1 || $router_matches[0] === '/wiki/') {
         if (!$this->is_allow_call_api) {
             $router_matches = $router_matches[0];
             $router_matches = explode("/", $router_matches);
             $gitName = "";
             foreach ($router_matches as $route_key => $router_match) {
                 if ($router_match == "1.0") {
                     $router_match = "v1";
                 }
                 if (empty($router_match)) {
                     continue;
                 }
                 $gitName .= "_" . $router_match;
             }
             $gitName = ltrim($gitName, "_");
             if ($gitName == "" || $gitName == "wiki") {
                 $gitName = "README";
             }
             $gitContent = self::get_data_from_url("http://git.corp.anjuke.com/mobile/doc/browse/master/docs_customer/API/app2/" . $gitName . ".md", "html");
             $gitContent2 = str_replace("/static/", "http://git.corp.anjuke.com/static/", $gitContent["data"]);
             $gitContent3 = str_replace("/mobile/doc/", "http://git.corp.anjuke.com/mobile/doc/", $gitContent2);
             $this->_request->set_attribute("gitContent", $gitContent3);
             echo $gitContent3;
             exit;
         } else {
             header("location:" . "http://www.anjuke.com", true, 302);
             exit;
         }
     } else {
         $_params = $this->_request->get_parameters();
         $url = $_params['POST_URL'];
         //            $SignatureInterceptor = new SignatureInterceptor();
         //
         //
         //            unset($_params['POST_URL']);
         //
         //            $signres = $SignatureInterceptor->signature($url,array(),$_params,"33684af373d0f6c7");
         //            $heaers = array("key: ee20a1640951687026333adf2083d9b1","sig: ".$signres."");
         $result = Util_CallAPI::get_data_from_url("http://api.anjuke.test/mobile-ajk-broker" . $url, 'json', $_params);
         echo json_encode($result['data']);
         exit;
     }
 }
Пример #24
0
 /**
  * 帐号解冻。
  * @param int $user_id 二手房用户ID。
  * @param int $amount 消费金额
  * @param int $proid 房源ID
  * @param string $app 引用的业务。可能值:JP,ZF,AJK
  * @param int $sn 流水号
  * @param string $note 备注信息
  * @param bool $newFrozen 是否使用新的扣费程序
  * @param bool|string $requestId 是否使用外部requestId
  * @return string $sn
  */
 public static function cancel_frozen($user_id, $amount, $proid, $app, $sn, $note = '', $newFrozen = false, $requestId = false)
 {
     $ret = FALSE;
     // 新扣费程序
     if ($newFrozen) {
         $info = Bll_Service_Payment::bidUnfreeze($app, array('userId' => $user_id, 'reqId' => $requestId ? $requestId : self::get_reqid($proid, $app), 'amount' => (int) ($amount * 100), 'frozenSN' => $sn, 'note' => $note));
         return strcasecmp(trim($info['status']), 'ok') == 0 || $info['code'] == 398507;
     } else {
         $url_path = 'use';
         $params = array('userId' => $user_id, 'reqId' => $requestId ? $requestId : self::get_reqid($proid, $app), 'amount' => (int) ($amount * 100), 'frozenSN' => $sn, 'note' => $note);
         $info = Util_CallAPI::call_internal_exes_api($url_path, 'hz_bid', $params);
         if ($info['data']['status'] === 'ok') {
             $ret = $info['data']['data']['sn'];
         }
     }
     return $ret;
 }
Пример #25
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;
 }
Пример #26
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params["brokerId"];
     $planId = $this->_params["planId"];
     if (empty($planId) && !empty($brokerId)) {
         $planInfo = Model_Plan_EsfFixedPlan::getValidPlan($brokerId);
         $planId = $planInfo['id'];
     }
     $post = array('brokerId' => $brokerId, 'planId' => $planId, 'proIds' => $this->_params['propIds']);
     $api_url = '/service-ppc/rest/ppc/planAddProperty';
     $result = Util_CallAPI::get_data_from_java_api($api_url, $post);
     if ($result['data']['status'] == 'ok') {
         $return = array('status' => 'ok', 'data' => array());
     } else {
         $return = Util_MobileAPI::error(self::changeJavaAPICodeToSelfCode($result['data']['code']));
     }
     return $return;
 }
Пример #27
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params["brokerId"];
     $planId = $this->_params["planId"];
     if (empty($planId)) {
         $planInfo = Model_Plan_EsfFixedPlan::getValidPlan($brokerId);
         $planId = $planInfo['id'];
     }
     $post = array('brokerId' => $brokerId, 'planId' => $planId, 'from' => APF::get_instance()->get_config('java_api_from'));
     $url = '/service-ppc/rest/ppc/restartPpc';
     $data = Util_CallAPI::get_data_from_java_api($url, $post);
     if ($data['data']['status'] === 'ok') {
         $ret = array('status' => 'ok', 'data' => array());
     } else {
         return Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']);
     }
     return $ret;
 }
Пример #28
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $plans = Model_Plan_EsfFixedPlan::getValidPlan($brokerId);
     $props = 0;
     $result['status'] = 'ok';
     if (!empty($plans)) {
         $planId = $plans['id'];
         $cityId = $plans['cityid'] ?: 0;
         $relations = Model_Plan_AjkFixRelation::getRelationListByPlanId($planId, $cityId);
         if (!empty($relations)) {
             $propIds = array();
             foreach ($relations as $row) {
                 $propIds[] = $row['proId'];
             }
             $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId);
             $props = count($houseInfo);
         }
         $planBll = new DAO_My_Ppc_PlanOpe();
         $clicks = $planBll->planTodayNewCost($planId);
         $data['planId'] = $planId;
         $data['todayClicks'] = $clicks['allclick'];
         $data['todayConsume'] = Util_Formatter::formatTodayConsume($clicks['allamount']);
         $data['todayConsumeUnit'] = '元';
         $data['totalProps'] = $props;
         //获取计划状态
         $api_url = '/service-ppc/rest/ppc/getPpcPlan/' . $planId . '?resType=1';
         $plan_info = Util_CallAPI::get_data_from_java_api($api_url);
         $data['planStatus'] = $plan_info['data']['plan']['statusDescrip'] == '推广中' ? 1 : 0;
         $limitInfo = Bll_Fixedspread_AjkFixedSpread::getLimitInfo($brokerId);
         $data['budget'] = !empty($limitInfo) ? round($limitInfo['amountLimit'] / 100, 2) : 0;
         $data['budgetUnit'] = '元';
     } else {
         $brokerInfo = Model_Broker_AjkBrokerExtend::getDataByBrokerId($brokerId);
         $planId = Model_Plan_EsfFixedPlan::addPlan('定价推广组', 1, $brokerInfo->cityId, $brokerInfo->userId, $brokerInfo->brokerId);
         $data['planId'] = $planId;
         $data['todayClicks'] = $data['todayConsume'] = $data['totalProps'] = $data['planStatus'] = 0;
         $data['todayConsumeUnit'] = $data['budgetUnit'] = '元';
         $limitInfo = Bll_Fixedspread_AjkFixedSpread::getLimitInfo($brokerId);
         $data['budget'] = !empty($limitInfo) ? round($limitInfo['amountLimit'] / 100, 2) : 0;
     }
     $result['data'] = $data;
     return $result;
 }
Пример #29
0
 /**
  * @return array|string
  * 入参:brokerId/经纪人ID
  * 出参:标准返参
  */
 public function handle_request_internal()
 {
     $brokerId = (int) $this->_params['brokerId'];
     $planId = (int) $this->_params['planId'];
     $ceiling = $this->_params['ceiling'];
     //计划名称。这个名称将会更新为计划的新名称,所以如果不想改名的话务必把计划的本来名字传过来。
     $planname = $this->_params['planname'];
     $post = array('brokerId' => $brokerId, 'planId' => $planId, 'ceiling' => $ceiling * 100, 'planName' => $planname, 'from' => APF::get_instance()->get_config('java_api_from'));
     $url = '/service-ppc/rest/ppc/changeCeiling';
     $data = Util_CallAPI::get_data_from_java_api($url, $post);
     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;
 }
Пример #30
0
 public function handle_request_internal()
 {
     //上海不让竞价
     $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId']));
     if (!Bll_City::isBidCity($city_info['CITYID'])) {
         $error_code = Const_HzErrorInfo::NOBIDCITY;
         return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code));
     }
     $post = array('brokerId' => $this->_params["brokerId"], 'propId' => $this->_params["propId"], 'budget' => (int) ($this->_params["budget"] * 100), 'offer' => (int) ($this->_params["offer"] * 100), 'from' => APF::get_instance()->get_config('java_api_from'));
     $url = '/service-ppc/rest/hp/refOpenHPlan';
     $data = Util_CallAPI::get_data_from_java_api($url, $post);
     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_tmp($data['data']['code'], $data['data']['info']);
     }
     return $ret;
 }