public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $cityId = $this->_params['cityId']; //二手房 $ajk_ppc_info = Bll_BrokerInfoApp::get_broker_ppc_info($brokerId); //租房 $hz_ppc_info = Bll_BrokerInfoApp::get_broker_ppc_info_hz($brokerId, $cityId); //经纪人基础信息 $brokerBaseInfo = Bll_BrokerInfoApp::get_broker_baseinfo_simple($brokerId); try { $chatInfo = Bll_Mobile_ChatInfoBll::getInstance()->getChatInfo($brokerId, 1); $chatId = $chatInfo['data']['chatId']; $twoCodeIcon = $chatInfo['data']['twoCodeIcon']; } catch (Exception $e) { $chatId = ''; $twoCodeIcon = ''; } //get bid flg for city $choiceCityFlag = Bll_City::isChoiceCity($cityId); // chat_token $info = array('phone' => $brokerBaseInfo['phone'], 'user_id' => $chatInfo['data']['chatId'], 'device' => array('app_name' => APF::get_instance()->get_config('java_api_from'), 'os' => $this->_params["o"], 'macid' => $this->_params["macid"], 'udid2' => $this->_params["udid2"])); $privateKey = APF::get_instance()->get_config('aes_private_key', 'mobile_api'); $iv = APF::get_instance()->get_config('aes_iv', 'mobile_api'); $token3rd = Util_CryptUtil::aes_encode($privateKey, $iv, $info); $ajk_dic_info = array('ajkClick' => $ajk_ppc_info['ajkClick'], 'ajkConsume' => $ajk_ppc_info['ajkConsume'], 'ajkFixHouse' => $ajk_ppc_info['ajkFixHouse'], 'ajkBidHouseNum' => $ajk_ppc_info['ajkBidHouseNum'], 'ajkNotFixHouseNum' => $ajk_ppc_info['ajkNotFixHouseNum'], 'haveAjk' => intval($ajk_ppc_info['ajkNotFixHouseNum']) + intval($ajk_ppc_info['ajkFixHouse'][0]['fixNum']) > 0 ? 1 : 0); $hz_dic_info = array('hzClick' => $hz_ppc_info['hzClick'], 'hzConsume' => $hz_ppc_info['hzConsume'], 'hzFixHouse' => $hz_ppc_info['hzFixHouse'], 'hzBidHouseNum' => $hz_ppc_info['hzBidHouseNum'], 'hzNotFixHouseNum' => $hz_ppc_info['hzNotFixHouseNum'], 'haveHz' => intval($hz_ppc_info['hzNotFixHouseNum']) + intval($hz_ppc_info['hzFixHouse'][0]['fixNum']) > 0 ? 1 : 0); if ($choiceCityFlag) { $ajk_dic_info['ajkBidHouseNum'] = 0; $hz_dic_info['hzBidHouseNum'] = 0; } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('ajkDataDic' => $ajk_dic_info, 'hzDataDic' => $hz_dic_info, 'brokerName' => $brokerBaseInfo['brokerName'], 'phone' => $brokerBaseInfo['phone'], 'chatId' => $chatId, 'twoCodeIcon' => $twoCodeIcon, 'tokenChat' => $token3rd)); }
public function handle_request_internal() { if (isset($this->_params['brokerId'])) { $brokerId = $this->_params['brokerId']; $brokerInfo = Bll_BrokerInfoApp::get_broker_baseinfo_app($brokerId); if (!empty($brokerInfo)) { $r['status'] = 'ok'; $r['data']['brokerInfo'] = $brokerInfo; } else { return Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR); } return $r; } else { return Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS); } }
public function handle_request_internal() { if (isset($this->_params['brokerId']) && isset($this->_params['cityId'])) { $brokerId = $this->_params['brokerId']; $cityId = $this->_params['cityId']; $chatFlag = $this->_params['chatFlag']; $brokerInfo = Bll_BrokerInfoApp::get_broker_info_app_v2($brokerId, $cityId); $brokerBaseInfo = Bll_BrokerInfoApp::get_broker_baseinfo_simple($brokerId); if (!empty($brokerInfo)) { $r = $this->get_result($brokerBaseInfo, $brokerInfo); //获取经纪人微聊信息 if ($chatFlag && 1 == $chatFlag) { try { $chatInfo = Bll_Mobile_ChatInfoBll::getInstance()->getChatInfo($brokerId, 1); $r['data']['chatId'] = $chatInfo['data']['chatId']; $r['data']['twoCodeIcon'] = $chatInfo['data']['twoCodeIcon']; } catch (Exception $e) { $r = Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR); } } } else { $r = Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR); } } else { if (!isset($this->_params['brokerId'])) { $r = Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS); } elseif (!isset($this->_params['cityId'])) { $r = Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS); } else { $r = Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR); } } //生成第三方API所需token if ($chatFlag && 1 == $chatFlag) { $info = array('phone' => $brokerBaseInfo['phone'], 'user_id' => $chatInfo['data']['chatId'], 'device' => array('app_name' => APF::get_instance()->get_config('java_api_from'), 'os' => $this->_params["o"], 'macid' => $this->_params["macid"], 'udid2' => $this->_params["udid2"])); $token3rd = self::createToken3rd($info); $r['data']["tokenChat"] = $token3rd; } return $r; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $cityId = $this->_params['cityId']; if (!Bll_City::isBidCity($cityId)) { return array('status' => 'ok', 'data' => array('propertyList' => array())); } if (Bll_Broker_HzBroker::isComboBroker($brokerId)) { $props = Bll_BrokerInfoApp::get_combo_canbid_props($brokerId, $cityId); } else { $props = Bll_BrokerInfoApp::get_canbid_props($brokerId, $cityId); } if (!empty($props)) { $return = array(); $return["status"] = "ok"; $return["data"]['propertyList'] = array(); $proprow = array(); foreach ($props as $propertyList) { $proprow["id"] = isset($propertyList['ProId']) ? $propertyList['ProId'] : $propertyList->proId; $proprow["title"] = isset($propertyList['ProName']) ? $propertyList['ProName'] : $propertyList->proName; $proprow["commId"] = isset($propertyList['CommId']) ? $propertyList['CommId'] : $propertyList->commId; $proprow["commName"] = isset($propertyList['CommName']) ? $propertyList['CommName'] : $propertyList->commName; $proprow["roomNum"] = isset($propertyList['RoomNum']) ? $propertyList['RoomNum'] : $propertyList->roomNum; $proprow["hallNum"] = isset($propertyList['HallNum']) ? $propertyList['HallNum'] : $propertyList->hallNum; $proprow["toiletNum"] = isset($propertyList['ToiletNum']) ? $propertyList['ToiletNum'] : $propertyList->toiletNum; $proprow["area"] = isset($propertyList['AreaNum']) ? $propertyList['AreaNum'] : $propertyList->areaNum; $proprow["price"] = isset($propertyList['ProPrice']) ? $propertyList['ProPrice'] : $propertyList->proPrice; $proprow["isMoreImg"] = isset($propertyList['IsHighQulity']) ? $propertyList['IsHighQulity'] : $propertyList->isHighQulity; $proprow["priceUnit"] = "万"; $return["data"]['propertyList'][] = $proprow; unset($proprow); } } else { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array())); } return $return; }
public function getPpcPropsInOneComm($brokerId, $cityId, $commId = '') { //获取该经纪人下所有的房源列表(竞价、定价) $props = Bll_BrokerInfoApp::get_broker_fixprops($brokerId, $cityId); $base_domain = APF::get_instance()->get_config('base_domain'); $propIds = array(); foreach ($props as $propArr) { $propIds[] = $propArr['ProId']; } //房源点击量 $proClickDao = new DAO_My_Ppc_PlanOpe(); $proClickInfo = $proClickDao->getProClick($propIds, strtotime("20120901")); //房源计划形态(是精选还是竞价) $spreads = array(); if ($propIds) { $spreads = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propIds); } if (!empty($spreads)) { foreach ($spreads as $row) { $spreadArr[$row['propId']]['bidVersion'] = $row['bidVersion']; $spreadArr[$row['propId']]['status'] = $row['status']; } } if (!empty($props)) { foreach ($props as $propArr) { $propId = $propArr['ProId']; $commProps[$propArr['CommId']][$propId]['id'] = $propId; $commProps[$propArr['CommId']][$propId]['title'] = $propArr['ProName']; $commProps[$propArr['CommId']][$propId]['commId'] = $propArr['CommId']; $commProps[$propArr['CommId']][$propId]['commName'] = $propArr['CommName']; $commProps[$propArr['CommId']][$propId]['roomNum'] = $propArr['RoomNum']; $commProps[$propArr['CommId']][$propId]['hallNum'] = $propArr['HallNum']; $commProps[$propArr['CommId']][$propId]['toiletNum'] = $propArr['ToiletNum']; $commProps[$propArr['CommId']][$propId]['area'] = $propArr['AreaNum']; $commProps[$propArr['CommId']][$propId]['price'] = $propArr['ProPrice']; $commProps[$propArr['CommId']][$propId]['priceUnit'] = '万'; $commProps[$propArr['CommId']][$propId]['isVisible'] = $propArr['IsVisible']; $commProps[$propArr['CommId']][$propId]['imgUrl'] = 'http://pages.anjukestatic.com/img/global/nopic_100x75.gif'; $commProps[$propArr['CommId']][$propId]['isMoreImg'] = $propArr['IsHighQulity'] ? 1 : 0; $commProps[$propArr['CommId']][$propId]['isPhonePub'] = $propArr['UriCode'] == 'mobile.asyn' || $propArr['UriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0; $commProps[$propArr['CommId']][$propId]['propUrl'] = 'http://' . $base_domain . '/web/sale/x/' . $propArr['CityId'] . '/' . $propId; $commProps[$propArr['CommId']][$propId]['createTime'] = date('Y-m-d H:i:s', $propArr['PostDate']); $commProps[$propArr['CommId']][$propId]['totalClicks'] = isset($proClickInfo[$propId]) ? $proClickInfo[$propId] : 0; $commProps[$propArr['CommId']][$propId]['isBid'] = $commProps[$propArr['CommId']][$propId]['isChoice'] = 0; if (isset($spreadArr) && isset($spreadArr[$propId])) { if ($spreadArr[$propId]['bidVersion'] == 1 && $spreadArr[$propId]['status'] == 1) { $commProps[$propArr['CommId']][$propId]['isBid'] = 1; } elseif ($spreadArr[$propId]['bidVersion'] == 2 && ($spreadArr[$propId]['status'] == 1 || $spreadArr[$propId]['status'] == 11)) { $commProps[$propArr['CommId']][$propId]['isChoice'] = 1; } } $imgBll = Bll_Image_EsfHouseImage::getInstance(); $commProps[$propArr['CommId']][$propId]['imgUrl'] = $imgBll->getThumbImageUrl($propId, $propArr['CommId']); } } $return = $commProps; if ($commId) { $ret['status'] = 'ok'; $ret['data']['propertyList'] = $return[$commId] ? array_values($return[$commId]) : array(); } else { $ret = $return; } return $ret; }
public function handle_request_internal() { //check param $checkParamMessage = $this->checkParames($this->_params); if ($checkParamMessage !== true) { return $checkParamMessage; } //params $brokerId = $this->_params['brokerId']; $cityId = $this->_params['cityId']; //get anjuke data $data = $this->getAnjukeData($brokerId, $cityId); //get bid flg for city $choiceCityFlag = Bll_City::isChoiceCity($cityId); if ($data['data']['status'] === 'ok') { $output = array(); //竞价计划信息 $bidPlanNum = 0; if (!empty($data['data']['bidPlan'])) { $bidPlanNum = $data['data']['bidPlan'][0]['bidPlanNum']; if ($choiceCityFlag) { $bidPlanNum = 0; } } //定价计划信息 if (empty($data['data']['pricPlan'])) { $fixPlan = array(); } else { $fixPlan = array(); foreach ($data['data']['pricPlan'] as $info) { $status = 1; switch (trim($info['pricPlanStateDesc'])) { case '计划推广中': $status = 1; break; case '手动暂停': $status = 2; break; case '待推广': $status = 2; break; case '余额不足已结束': $status = 2; break; // case '余额不足暂停': // $status = 3; // break; // case '余额不足暂停': // $status = 3; // break; default: break; } $tmp = array('fixPlanId' => $info['pricPlanId'], 'fixPlanName' => $info['pricPlanName'], 'fixPlanPropNum' => $info['pricPlanPropNum'], 'fixPlanState' => $status, 'fixPlanStateDesc' => $info['pricPlanStateDesc']); $fixPlan[] = $tmp; } $a = function ($a, $b) { if ($a['fixPlanId'] == $b['fixPlanId']) { return 0; } return $a['fixPlanId'] < $b['fixPlanId'] ? -1 : 1; }; usort($fixPlan, $a); } $output['fixPlan'] = $fixPlan; //未推广房源列表 $props = Bll_BrokerInfoApp::get_outline_prop($brokerId, $cityId); $output['unRecommendPropNum'] = count($props); $output['bidPlan'] = array('bidPlanPropNum' => $bidPlanNum); $ret = array('status' => 'ok', 'data' => $output); } else { $ret = Util_MobileAPI::error(Const_APIStatus::RETURN_CODE_ERROR); } return $ret; }
public function handle_request() { $CurrentUrl = APF::get_instance()->get_request()->get_current_url(); if (!$this->isBrokerLogin()) { APF::get_instance()->get_response()->redirect(Uri_MemberUrl::login_url($CurrentUrl)); exit; } $baseDomain = APF::get_instance()->get_config('base_domain', 'common'); $baseUri = defined('BASE_URI') ? BASE_URI : ''; $indexUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/index"; $joinUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/join"; $flag = ''; if (preg_match("/join\\/(\\d+)/", $_SERVER["REQUEST_URI"], $matches)) { if ($matches[1] && is_numeric($matches[1])) { $flag = $matches[1]; } } $request = APF::get_instance()->get_request(); $params = $request->get_parameters(); $request->set_attribute('indexUrl', $indexUrl); $broker_id = $request->getBrokerId(); //$broker_id = 100100; $user_id = $request->getUserId(); $dao = new Bll_Goodbroker(); //获取审核状态 $verify = $dao->getIsVerify($broker_id); $is_verify = $verify === false ? $verify : $verify['is_verify']; $realname = $dao->getBrokername($broker_id); $info['realname'] = $realname; $request->set_attribute('realname', $realname); if ($is_verify === '0') { //报名未审核 $request->set_attribute('code', '3'); return 'Goodbroker_Info'; } elseif ($is_verify == 1) { //审核通过 $show_url = "http://my.{$baseDomain}{$baseUri}/goodbroker/show"; $show_url .= '/' . $broker_id; $request->set_attribute('url', $show_url); $request->set_attribute('code', '1'); return 'Goodbroker_Info'; } elseif ($is_verify == 2 && $flag == '') { //审核不通过 $show_url = "http://my.{$baseDomain}{$baseUri}/goodbroker/join"; $show_url .= "/" . $broker_id; $request->set_attribute('reason', $verify['reason']); $request->set_attribute('url', $show_url); $request->set_attribute('code', '2'); return 'Goodbroker_Info'; } if ($is_verify == 2 && $flag == $broker_id) { //审核不通过重新修改资料 $info = $dao->getBrokerInfo($broker_id); $request->set_attribute('info', $info); } $info['photo'] = strlen($params['default_photo']) == 32 ? $params['default_photo'] : $params['photoes'][0]; if ($params['slogan'] && $params['story'] && $params['photoes']) { if (strlen($params['slogan']) > 100) { $error['slogan'] = '参赛口号限20字以内'; } else { $info['slogan'] = htmlentities($params['slogan'], ENT_QUOTES | ENT_IGNORE, "UTF-8"); } if (strlen($params['story']) > 2000) { $error['story'] = '个人故事限500字以内'; } else { $info['story'] = htmlentities($params['story'], ENT_QUOTES | ENT_IGNORE, "UTF-8"); } $photoes = $params['photoes']; if (count($photoes) < 3 || count($photoes) > 8) { $error['story'] = '照片数最少3张最多8张 '; } if (isset($error) && !empty($error)) { $request->set_attribute('error', $error); } else { $base = Bll_BrokerInfoApp::get_goodbroker_info($broker_id); $info['city_id'] = $base['city_id']; $info['phone'] = $base['phone']; $info['company_name'] = $base['company']; $info['store_name'] = $base['store']; //获取经纪人的注册时间以及在售房源数 $info['register_time'] = $dao->getBrokerRegtime($user_id); $info['on_sale'] = Bll_Goodbroker::getSpreadProCount($broker_id, $base['city_id']); $dao->addBrokerInfo($broker_id, $info, $photoes); $request->set_attribute('code', '3'); $this->redirect($joinUrl); //return 'Goodbroker_Info'; } } return 'Goodbroker_Join'; }
/** * 获取经纪人的姓名 */ public function getBrokername($broker_id) { $bll = new Bll_BrokerInfoApp(); $info = $bll->get_broker_baseinfo_simple($broker_id); return $info['brokerName']; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $cityId = $this->_params['cityId']; $props = Bll_BrokerInfoApp::get_outline_prop($brokerId, $cityId); $return = array(); $return['status'] = 'ok'; $return['data']['propertyList'] = array(); //APP套餐城市调错API了 需要做一下套餐城市的兼容处理 $isComboBroker = Bll_Broker_HzBroker::isComboBroker($brokerId); if (!$isComboBroker) { if (!empty($props)) { $propRow = array(); foreach ($props as $propertyList) { $propRow['propId'] = $propRow['id'] = $propertyList['ProId']; $propRow['title'] = $propertyList['ProName']; $propRow['commId'] = $propertyList['CommId']; $propRow['commName'] = $propertyList['CommName']; $propRow['roomNum'] = $propertyList['RoomNum']; $propRow['hallNum'] = $propertyList['HallNum']; $propRow['toiletNum'] = $propertyList['ToiletNum']; $propRow['area'] = round($propertyList['AreaNum']); $propRow['price'] = is_float($propertyList['ProPrice']) ? round($propertyList['ProPrice'], 1) : $propertyList['ProPrice']; $propRow['priceUnit'] = '万'; $propRow['isMoreImg'] = $propertyList['IsHighQulity']; $propRow['isVisible'] = $propertyList['IsVisible']; $propRow['isPhonePub'] = $propertyList['UriCode'] == 'mobile.asyn' || $propertyList['UriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0; $propRow['createTime'] = date('Y-m-d H:i:s', $propertyList['PostDate']); $imgBll = Bll_Image_EsfHouseImage::getInstance(); $propRow['imgUrl'] = $imgBll->getThumbImageUrl($propertyList['ProId'], $propertyList['commId']); //增加委托房源标签 if ($propertyList['CommitionType'] == 2) { $propRow['isEntrust'] = 1; } else { $propRow['isEntrust'] = 0; } $return['data']['propertyList'][] = $propRow; unset($propRow); } } return $return; } else { $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS); } //获取套餐推广信息 $cityId = $brokerInfo->cityId; $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerId, $cityId); $comboSpreadHouseIds = array_keys($comboSpreadHouseList); //获取经纪人所有房源信息 $tempHouseInfoList = Bll_House_EsfHouse::getBrokerAllPropInfoList($brokerId, $cityId); if (empty($tempHouseInfoList)) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array())); } //未推广房源列表 $tempNoSpreadHouseList = array(); $noSpreadHouseIds = array(); foreach ($tempHouseInfoList as $houseInfo) { if (!in_array($houseInfo['proId'], $comboSpreadHouseIds)) { $houseInfo['illegal'] = isset($houseInfo['isVisible']) ? $houseInfo['isVisible'] : 1; //0-违规房源 1-非违规房源 $tempNoSpreadHouseList[$houseInfo['proId']] = $houseInfo; $noSpreadHouseIds[] = $houseInfo['proId']; } } /** 过滤违规房源 */ $tmpIllegalList = array(); if (!$noSpreadHouseIds) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array())); } foreach ($tempNoSpreadHouseList as $propId => $houseInfo) { if ($houseInfo['illegal'] == 0 && $houseInfo['expireWorker'] != 'propertyReport') { $tmpIllegalList[$propId] = $houseInfo; unset($tempNoSpreadHouseList[$propId]); } } //违规房源排在前面 $noSpreadHouseList = array_merge($tmpIllegalList, $tempNoSpreadHouseList); $propDefImages = Model_House_AjkPropertyData::getDafImages($noSpreadHouseIds); $propertyList = array(); foreach ($noSpreadHouseList as $houseInfo) { $row = array(); $row['propId'] = $houseInfo['proId']; $row['title'] = $houseInfo['proName']; $row['commId'] = $houseInfo['commId']; $row['commName'] = $houseInfo['commName']; $row['roomNum'] = $houseInfo['roomNum']; $row['hallNum'] = $houseInfo['hallNum']; $row['area'] = round($houseInfo['areaNum']); $row['toiletNum'] = $houseInfo['toiletNum']; $row['price'] = intval($houseInfo['proPrice']); $row['priceUnit'] = '万'; $row['isBid'] = 0; $row['isChoice'] = 0; $row['isMoreImg'] = $houseInfo['isHighQulity']; $row['isPhonePub'] = $houseInfo['uriCode'] == 'mobile.asyn' || $houseInfo['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0; $row['isVisible'] = $houseInfo['illegal']; //0-违规房源 1-非违规房源 $row['createTime'] = $houseInfo['postDate']; //房源发布时间 $row['imgUrl'] = $row['imgUrl'] = Model_House_AjkPropertyData::imageUrl($propDefImages[$houseInfo['proId']]); //print_r($houseInfo['commitionType']);exit; $row['isEntrust'] = $houseInfo['commitionType'] == 2 ? 1 : 0; $propertyList[] = $row; } //排序 usort($propertyList, function ($a, $b) { if ($a['createTime'] == $b['createTime']) { return 0; } return $a['createTime'] > $b['createTime'] ? -1 : 1; }); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => $propertyList)); } }