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; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; $budget = $this->_params['budget']; $offer = $this->_params['offer']; $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)); } $planInfo = $this->get_hpplan_info($propId); $post = array('brokerId' => $brokerId, 'propId' => $propId, 'budget' => $budget * 100 - $planInfo['budget'], 'offer' => $offer * 100, 'from' => APF::get_instance()->get_config('java_api_from')); $url = '/service-ppc/rest/hp/updHPlan'; $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); if ($translate_errcode === FALSE) { $ret = Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']); } else { $ret = Util_MobileAPI::error($translate_errcode); } } return $ret; }
/** * init env * @param AJKRequest $request * @param $out * @throws Exception */ private static function initEnv($request, &$out) { $out['debug'] = isset($_GET['debug']) ? true : false; $out['cityId'] = $request->getBrokerCityId(); $out['ajkBrokerId'] = $request->getBrokerId(); $out['isComboBroker'] = Bll_Broker_HzBroker::isComboBroker($out['ajkBrokerId']); $route_matches = $request->get_router_matches(); $out['proId'] = trim($route_matches[2], "/ \t\n\r\v"); if (!$out['proId']) { throw new Exception('缺少房源Id参数'); } $jpMemberInfo = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($out['ajkBrokerId']); // 获取金铺brokerId $out['jpBrokerId'] = $jpMemberInfo->id; // 是否精选 $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::JINPU); $out['isBidCity'] = Bll_City::isBidCity($out['cityId'], Const_Site::JINPU); if ($out['isChoiceCity'] || $out['isBidCity']) { $out['bidTip'] = $out['isChoiceCity'] ? '精选' : '竞价'; $out['bidUrl'] = $out['isChoiceCity'] ? '/ajkbroker/user/choice/set/jp/' . $out['proId'] : '/jinpu/bid/new/' . $out['proId']; } $multicity = APF::get_instance()->get_config("cities", "multicity"); $out['cityName'] = $multicity[$out['cityId']]; // 获取经纪人信息 if (!($out['brokerInfo'] = Model_Broker_JpBroker::data_access()->filter('id', $jpMemberInfo->id)->get_row())) { throw new Exception('获取金铺经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']'); } }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; // 判断经纪人是否存在 $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); $hzBrokerId = Model_Broker_MainBusiness::getHzBrokerIdByAjkBrokerId($brokerId); if (!$hzBrokerId || !$broker) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $broker['cityId']; if (!Bll_City::isBidCity($cityId)) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'totalProps' => 0)); } // 获取今日房源点击和消费记录 $clicksInfo = Model_Stats_PropClick::getClickInfoByBrokerId($hzBrokerId, $cityId); // 统计今日竞价点击和消费 $todayClicks = 0; $todayConsume = 0; foreach ($clicksInfo as $objClick) { $todayClicks += $objClick->bid_cnum; $todayConsume += $objClick->bid_cost; } // 获取竞价房源数 $bidPropNum = Bll_HzBidPlan::get_broker_bidprop_count($hzBrokerId); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => $todayClicks, 'todayConsume' => Util_Formatter::formatTodayConsume($todayConsume / 100), 'todayConsumeUnit' => '元', 'totalProps' => $bidPropNum)); }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; $budget = $this->_params['budget']; $offer = $this->_params['offer']; //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); if ($brokerId_hz) { $broker_info = Dao_Broker_HzPlan::get_hzbroker_info($brokerId_hz); if (!Bll_City::isBidCity($broker_info['cityid'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } } $plan_id = Bll_HzBidPlan::get_planid_by_propid($propId); //@todo 不明白为什么一定要用propid而不用计划id $ret_offer = Bll_HzBidPlan::change_bid_offer($plan_id, $offer); //修改出价 $ret_budget = Bll_HzBidPlan::change_bid_budget($plan_id, $budget); //修改预算 ----$new_amount 为需要增加的预算 $r = array(); if ($ret_offer['status'] && $ret_budget['status']) { $r = array('status' => 'ok', 'data' => array()); } else { if (!$ret_offer['status']) { $r = array('status' => 'error', 'errcode' => $ret_offer['msg'], 'message' => Bll_HzFixPlan::get_message_from_code($ret_offer['msg'])); } if (!$ret_budget['status']) { $r = array('status' => 'error', 'errcode' => $ret_budget['msg'], 'message' => Bll_HzFixPlan::get_message_from_code($ret_budget['msg'])); } } return $r; }
public function handle_request_internal() { /** * @var $request AJKRequest */ $request = apf::get_instance()->get_request(); if (!Bll_City::isBidCity($request->getBrokerCityId())) { echo '{"status":"error", "msg":"不是竞价城市"}'; return; } $planId = intval($request->get_parameter('plan_id')); if ($planId <= 0) { $planId = intval($request->get_parameter('planId')); } if ($planId <= 0) { echo '{"status":"error"}'; return; } $planInfo = Bll_Plan_Bid_AjkPlan::getPlanByPlanId($planId); if (empty($planInfo) || !isset($planInfo['brokerId']) || $planInfo['brokerId'] != static::$intBrokerID) { echo json_encode(array('status' => 'error', 'msg' => '不能停止别人的计划')); return; } if (!isset($planInfo['status']) || ($planInfo['status'] == 1 || $planInfo['status'] == 11)) { $remark = sprintf('MODIFYTIME:%d=>%dSTATUS:%d=>%dSTOPTIME:%d=>%d', $planInfo['modifytime'], time(), $planInfo['status'], 3, $planInfo['stoptime'], time()); echo json_encode($this->stopPlan(static::$intBrokerID, static::$intBrokerCityID, $planId, $remark)); } elseif ($planInfo['tradestatus'] == 2 && in_array($planInfo['status'], array(3, 4, 5, 6, 7, 8, 9, 10))) { $remark = sprintf('MODIFYTIME:%d=>%dSTATUS:%d=>%d', $planInfo['modifytime'], time(), $planInfo['status'], 2); echo json_encode($this->deletePlan(static::$intBrokerID, static::$intBrokerCityID, $planId, $remark)); } else { echo '{"status":"ok","msg":"status error"}'; } return; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; //检查经纪人是否存在 $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $brokerInfo->cityId; if (!Bll_City::isBidCity($cityId)) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'totalProps' => 0)); } $data = array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元'); $datei = date('Ymd'); //获取经纪人竞价推广某天的点击和花费信息 $allClickAndCostInfo = Model_Plan_HpProStatsDay::getBrokerClickAndCostDay($brokerId, $cityId, $datei); foreach ($allClickAndCostInfo as $row) { $data['todayClicks'] += $row->cnum; $data['todayConsume'] += $row->amount / 100; } $data['todayConsume'] = Util_Formatter::formatTodayConsume($data['todayConsume']); //获取计划数 $data['totalProps'] = Model_Plan_EsfAjkPropSpread::getPlanCountByBroker($brokerId, Model_Plan_EsfAjkPropSpread::DEFAULTVERSION); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data); }
public function handle_request_internal() { //组织POST参数 $params = array(); if (!isset($this->_params['brokerId'])) { return Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS); } else { $broker_id = $this->_params["brokerId"]; } if (!isset($this->_params["cityId"])) { return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS); } if (!isset($this->_params["propId"])) { return Util_MobileAPI::error(Const_APIStatus::E_PROP_ID_MISS); } if (!isset($this->_params["offer"])) { return Util_MobileAPI::error(Const_APIStatus::E_PROP_BID_PRICE_MISS); } if (!Bll_City::isBidCity($this->_params["cityId"])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $search = new Util_SearchUtil(); $prop = Bll_HzProp::get_prop($this->_params["propId"]); $blockid = $prop['blockid']; $price = $prop['pricenum']; $price_block = Bll_HzBidPlan::get_price_block($this->_params["cityId"], $price); $ajkid = Bll_HzProp::get_subregion_id($prop['commId'], $this->_params["propId"]); $rank = $search->getHpRankByProp($this->_params["cityId"], $ajkid, $this->_params["propId"], $price_block['LOWER'], $price_block['UPPER'], $this->_params['offer']); $return = array(); $return["status"] = "ok"; $return["data"] = $rank; return $return; }
public function beforeHandlerRequest() { if (!Bll_City::isBidCity($this->cityId, Const_Site::HAOZU)) { $this->outPut(-1, '未开通竞价业务'); } // 获取好租brokerId if (!($this->params['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($this->brokerId))) { $this->outPut(-1, '获取好租信息失败'); } }
public function handle_request_internal() { $app = $this->_params['app']; $cv = $this->_params['cv']; $cityId = $this->_params['cityId']; $brokerId = isset($this->_params['brokerId']) ? $this->_params['brokerId'] : 0; if ($app == 'i-broker2' && $cv == 4.3) { if (Bll_City::isBidCity($cityId)) { $return['businessType'] = array('businessTypeId' => self::RETURN_CODE_NUM_BID, 'businessTypeName' => self::RETURN_CODE_MSG_BID); } else { if (Bll_City::isChoiceCity($cityId)) { $return['businessType'] = array('businessTypeId' => self::RETURN_CODE_NUM_CHOICE, 'businessTypeName' => self::RETURN_CODE_MSG_CHOICE); } else { $return['businessType'] = array('businessTypeId' => self::RETURN_CODE_NUM_NOTCHOICE_NOTBID, 'businessTypeName' => self::RETURN_CODE_MSG_NOTCHOICE_NOTBID); } } } else { if (Bll_City::isBidCity($cityId)) { $return['businessType'] = array('businessTypeId' => self::RETURN_CODE_NUM_BID, 'businessTypeName' => self::RETURN_CODE_MSG_BID); } else { $return['businessType'] = array('businessTypeId' => self::RETURN_CODE_NUM_CHOICE, 'businessTypeName' => self::RETURN_CODE_MSG_CHOICE); } } //查询房源库权限 //$brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); //$fykStatus = V1_Fyk_User_PrivilegesController::getFykStatus($brokerInfo->userId,$cityId); $fykStatus = array('isOpen' => 0, 'status' => -1, 'message' => '房源库功能已关闭'); $return['fykStatus'] = $fykStatus; //获取是否试套餐城市 $timeBool = Model_Combo_BusinessUseConfig::getCityComboConfig($cityId); if (Bll_City::isComboCity($cityId) && !empty($timeBool) && time() > $timeBool['startTime']) { $return['comboBusinessType']['businessTypeId'] = self::RETURN_COMBO_CITY_NUM_YES; $return['comboBusinessType']['businessTypeName'] = self::RETURN_COMBO_CITY_MSG_YES; if ($brokerId) { $result = Bll_Broker_HzBroker::isComboBroker($brokerId); if ($result === false) { $return['updateComboBusiness']['isUpdateToComboBusiness'] = 1; $return['updateComboBusiness']['updateMessage'] = '移动经纪人由定价模式升级为套餐模式,立即切换使用吧!'; } else { $return['updateComboBusiness']['isUpdateToComboBusiness'] = 0; $return['updateComboBusiness']['updateMessage'] = ''; } } } else { $return['comboBusinessType'] = array('businessTypeId' => self::RETURN_COMBO_CITY_NUM_NO, 'businessTypeName' => self::RETURN_COMBO_CITY_MSG_NO); } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $return); }
public function handle_request_internal() { //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); $city_id = $this->_params['cityId']; $result = Bll_HzFixPlan::get_broker_plans($brokerId_hz, $city_id); if (!empty($result)) { $return = array(); $return["status"] = "ok"; if (!Bll_City::isBidCity($city_id)) { $result['bidPlan']['bidPlanPropNum'] = 0; } $return['data'] = $result; } else { return Util_MobileAPI::error(Const_APIStatus::E_PLAN_PARAM_ERR); } return $return; }
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"], 'from' => APF::get_instance()->get_config('java_api_from')); $url = '/service-ppc/rest/hp/stopHPlan'; $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; }
public function handle_request_internal() { //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); if ($brokerId_hz) { $broker_info = Dao_Broker_HzPlan::get_hzbroker_info($brokerId_hz); if (!Bll_City::isBidCity($broker_info['cityid'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } } $ret = Bll_HzBidPlan::prop_out_bid($brokerId_hz, $this->_params['propId']); $r = array(); if ($ret['status']) { $r = array('status' => 'ok', 'data' => array()); } else { return Util_MobileAPI::error(Const_APIStatus::E_PLAN_PARAM_ERR); } return $r; }
public function handle_request_internal() { //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); if ($brokerId_hz) { $broker_info = Dao_Broker_HzPlan::get_hzbroker_info($brokerId_hz); if (!Bll_City::isBidCity($broker_info['cityid'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } } $propId = $this->_params['propId']; $planId = $this->_params['planId']; $ret = Bll_HzBidPlan::delete_bid($brokerId_hz, $planId, $propId); //竞价解冻开发中 if ($ret['status']) { $r = array('status' => 'ok', 'data' => array()); } else { $r = array('status' => 'error', 'errcode' => $ret['msg'], 'message' => Bll_HzFixPlan::get_message_from_code($ret['msg'])); } return $r; }
public function handle_request_internal() { $app = $this->_params['app']; $cv = $this->_params['cv']; $cityId = $this->_params['cityId']; // 基础业务类型 • 老端口 $isDuankou = Bll_City::isDuankouCity($cityId); // 基础业务类型 • 定价 $isFix = Bll_City::isFixCity($cityId); // 基础业务类型 • 新套餐 $isCombo = Bll_City::isComboCity($cityId); // 增值业务类型 • 竞价 $isBid = Bll_City::isBidCity($cityId); // 增值业务类型 • 精选 $isChoice = Bll_City::isChoiceCity($cityId); if ($app == 'i-broker2' && $cv == 4.3) { if (!$isBid) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('isDuankou' => intval($isDuankou), 'isFix' => intval($isFix), 'isCombo' => intval($isCombo), 'isChoice' => intval($isChoice))); } } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('isDuankou' => intval($isDuankou), 'isFix' => intval($isFix), 'isCombo' => intval($isCombo), 'isBid' => intval($isBid), 'isChoice' => intval($isChoice))); }
public function handle_request_internal() { //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); $proid = $this->_params['propId']; $cityId = $this->_params['cityId']; if (!Bll_City::isBidCity($cityId)) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $offer = $this->_params['offer']; //offer竞价出价 $budget = $this->_params['budget']; //amount竞价预算(冻结金额) $ret = Bll_HzBidPlan::prop_into_bid($brokerId_hz, $cityId, $proid, $offer, $budget, $this->_params['brokerId']); $r = array(); if ($ret['status']) { $r = array('status' => 'ok', 'data' => array()); } else { $r = array('status' => 'error', 'errcode' => $ret['msg'], 'message' => Bll_HzFixPlan::get_message_from_code($ret['msg'])); } 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 handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; //检查经纪人是否存在 $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $brokerInfo->cityId; if (!Bll_City::isBidCity($cityId)) { throw new Exception_City_NotBidCity('CityId: ' . $cityId); } //房子的竞价计划 $bidPlan = Model_Plan_EsfAjkPropSpread::getBidPlanInfoByHouseid($propId); if (empty($bidPlan)) { //房源信息 $propInfo = Bll_House_EsfHouse::getHouseBaseInfo($propId, $brokerInfo->cityId); if (!$propInfo[0]->isHighQulity) { throw new Exception_Property_NotMultiImages("Anjuke propId: {$propId}"); } throw new Exception_BidPlan_NotFound('PropId: ' . $propId); } //房源总点击 $bidClickInfo = Model_Plan_HpProStatsDay::getPropClicks($propId, $brokerInfo->cityId); $data = array(); $data['totalClicks'] = $bidClickInfo[$propId]['totalClicks']; //房源竞价总点击 $data['todayClicks'] = Model_plan_HpProStatsDay::getPropClickByDate($propId, $cityId, date('Ymd')); //今日点击 $data['planId'] = $bidPlan->id; $priceInfo = Model_House_EsfPrice::get_price($cityId, $bidPlan->propriceint); $data['minClickPrice'] = $priceInfo['vPrice']; //最小出价 $data['minClickPriceUnit'] = '元'; //最小出价 //推广中 排队中 if ($bidPlan->status == Model_Plan_EsfAjkPropSpread::ONLINE || $bidPlan->status == Model_Plan_EsfAjkPropSpread::ONQUEUE) { $data['planStatus'] = 1; // 推广中 or 排队中 $data['budget'] = $bidPlan->budget / 100; //预算 $data['budgetUnit'] = '元'; $consume = Model_plan_HpProStatsDay::getPlanAmounts($bidPlan->id, $cityId); $data['budgetRemain'] = ($bidPlan->budget - $consume) / 100; $data['budgetRemainUnit'] = '元'; $data['clickPrice'] = $bidPlan->offer / 100; //出价 $data['clickPriceUnit'] = '元'; $data['rankMsg'] = '排队中'; if ($bidPlan->status == Model_Plan_EsfAjkPropSpread::ONLINE) { //排名 $data['rank'] = $this->getPpcSaleRankBll($propId, $bidPlan->commId, $bidPlan->smallprice, $bidPlan->bigprice, $bidPlan->commsHpratioA, 3); $data['rankMsg'] = '推广中'; } } else { $data['planStatus'] = 2; //已暂停 $data['budget'] = 0; $data['budgetUnit'] = '元'; $data['budgetRemain'] = 0; $data['budgetRemainUnit'] = '元'; $data['clickPrice'] = 0; $data['clickPriceUnit'] = '元'; $data['rankMsg'] = '已暂停'; } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data); }
public function handle_request_internal() { /* @params planId :计划id @params resType :默认为0,0表示不取计划房源信息,1为取房源信息 @params from :来源 @success return 该计划id的信息 */ if (!isset($this->_params['brokerId'])) { return Util_MobileAPI::error(Const_APIStatus::E_PLAN_PARAM_BROKERID_MISS); } $brokerId = $this->_params['brokerId']; //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($brokerId); if ($brokerId_hz) { $broker_info = Dao_Broker_HzPlan::get_hzbroker_info($brokerId_hz); if (!Bll_City::isBidCity($broker_info['cityid'])) { return array('status' => 'ok', 'data' => array('propertyList' => array())); } } if (Bll_Broker_HzBroker::isComboBroker($brokerId)) { //获取套餐推广房源列表 $comboList = Bll_Combo_HouseRelation::getHouseRelations($brokerId, Bll_Combo_HouseRelation::SITE_TYPE_HZ, 1); if (!empty($comboList)) { foreach ($comboList as $combo) { $comboIds[$combo['houseId']] = 1; } //获取竞价房源 去除竞价房源 $validBidPlans = Model_Plan_HzPlanBasic::getBidPlansByBrokerId($brokerId_hz); $planIds = array(); if (!empty($validBidPlans)) { foreach ($validBidPlans as $plan) { if ($plan['flag'] == 1 && $plan['status'] != Const_HzPlan::DELETE) { $planIds[] = $plan['id']; } } if (!empty($planIds)) { $bidPlannings = Model_Plan_HzPlanning::getPlanningByPlanIds($planIds); } if (!empty($bidPlannings)) { foreach ($bidPlannings as $bid) { unset($comboIds[$bid['proid']]); } } } //$propertyList = Model_House_HzProp::getPropsByPropIds(array_keys($comboIds)); $propertyList = Dao_Broker_HzProp::get_prop(array_keys($comboIds)); if (!empty($propertyList)) { foreach ($propertyList as $key => $list) { if ($list['content_basic']['quality'] != 1) { unset($propertyList[$key]); } } } $result = $propertyList; } else { $result = array(); } //去除竞价房源和非多图房源 } else { $result = Bll_HzBidPlan::get_canbid_props($brokerId_hz); } $return = array(); $return["status"] = "ok"; $return["data"]['propertyList'] = array(); if (!empty($result)) { $proprow = array(); foreach ($result as $propertyList) { $proprow["id"] = $propertyList['proid']; $proprow["title"] = $propertyList['content_basic']['title']; $proprow["commId"] = $propertyList['content_basic']['commid']; $proprow["commName"] = $propertyList['content_basic']['commname']; $proprow["roomNum"] = $propertyList['content_basic']['roomnum']; $proprow["hallNum"] = $propertyList['content_basic']['hallnum']; $proprow["toiletNum"] = $propertyList['content_basic']['toilnetnum']; $proprow["area"] = round($propertyList['content_basic']['areanum']); $proprow["price"] = round($propertyList['content_basic']['pricenum']); $proprow["isMoreImg"] = $propertyList['content_basic']['quality'] ? 1 : 0; $proprow["priceUnit"] = "元"; $return["data"]['propertyList'][] = $proprow; unset($proprow); } unset($result); } return $return; }
public function handle_request_internal() { if (!$this->isBrokerLogin()) { $this->redirect_to_login(); } /** * @var $request AJKRequest */ $request = APF::get_instance()->get_request(); $objResponse = APF::get_instance()->get_response(); $params = $request->get_parameters(); $cityId = $request->getBrokerCityId(); $brokerId = $request->getBrokerId(); $userId = $request->getUserId(); $brokerInfo = self::$BrokerInfo['BaseInfo']; $siteType = $params['site_type']; //网站类型 $isChoiceCity = Bll_City::isChoiceCity($cityId); $isBidCity = Bll_City::isBidCity($cityId); //返回数据 $result = array(); //网站类型 $result['type'] = $siteType; //套餐、竞价近7天 $ComboClick = Bll_Combo_Broker_BrokerComboInfo::getBrokerSevenClick($brokerId, $cityId, $siteType, $isBidCity || $isChoiceCity); $result['today_click'] = $ComboClick['today_click']; //当前情况 $result['seven_days_click'] = $ComboClick['seven_days_click']; //7天情况 //推广房源优良中 $ComboProRank = Bll_Combo_Broker_BrokerComboInfo::getBrokerComboProRank($brokerId, $siteType, $cityId); if ($siteType == 'ajk' || $siteType == 'hz') { $result['combo_house_info']['comboCount'] = count($ComboProRank['list']); //套餐推广数 $result['combo_house_info']['superior'] = isset($ComboProRank['count'][3]['rankStarNum']) ? $ComboProRank['count'][3]['rankStarNum'] : 0; //优 $result['combo_house_info']['well'] = isset($ComboProRank['count'][2]['rankStarNum']) ? $ComboProRank['count'][2]['rankStarNum'] : 0; //良 $result['combo_house_info']['middling'] = isset($ComboProRank['count'][1]['rankStarNum']) ? $ComboProRank['count'][1]['rankStarNum'] : 0; //中 $result['combo_house_info']['undetermined'] = isset($ComboProRank['count'][0]['rankStarNum']) ? $ComboProRank['count'][0]['rankStarNum'] : 0; //待评 } else { $result['combo_house_info']['comboCount'] = count($ComboProRank['list']); //套餐推广数 $result['combo_house_info']['quality'] = isset($ComboProRank['count'][1]['exquisiteStarNum']) ? $ComboProRank['count'][1]['exquisiteStarNum'] : 0; //精品 $result['combo_house_info']['unQuality'] = isset($ComboProRank['count'][2]['exquisiteStarNum']) ? $ComboProRank['count'][2]['exquisiteStarNum'] : 0; //非经 } //查询违规房源数 $result['combo_house_info']['foul'] = Bll_Combo_Broker_BrokerComboInfo::getBrokerIllegalNum($brokerId, $cityId, $siteType); //违规 if ($isChoiceCity || $isBidCity) { //查询竞价房源数 $result['combo_house_info']['bidding'] = Bll_Combo_Broker_BrokerComboInfo::getBrokerBidNum($brokerId, $cityId, $siteType); //竞价 } //json字符串输出 $objResponse->set_content_type('application/json'); echo json_encode($result); // 给宋刘伟造的假数据 // $tmpArr = array( // 'type'=>'ajk', // 'today_click'=>array( // 'combo'=>65, // 'bidding'=>70, // ), // 'seven_days_click'=>array( // '7-1'=>array( // 'combo'=>30, // 'bidding'=>48, // ), // '7-2'=>array( // 'combo'=>23, // 'bidding'=>46, // ), // '7-3'=>array( // 'combo'=>28, // 'bidding'=>40, // ), // '7-4'=>array( // 'combo'=>32, // 'bidding'=>40, // ), // '7-5'=>array( // 'combo'=>40, // 'bidding'=>50, // ), // '7-6'=>array( // 'combo'=>50, // 'bidding'=>55, // ), // '7-7'=>array( // 'combo'=>65, // 'bidding'=>70, // ), // ), // 'combo_house_info'=>array( // 'comboCount'=>30,// // 'superior'=>20,//优 // 'well'=>5,//良 // 'middling'=>2,//中 // 'undetermined'=>3,//待评 // 'foul'=>0,//违规 // 'bidding'=>10,//竞价 // ), // ); // echo json_encode($tmpArr); return true; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; // 判断经纪人是否存在 $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); $hzBrokerId = Model_Broker_MainBusiness::getHzBrokerIdByAjkBrokerId($brokerId); if (!$hzBrokerId || !$broker) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $broker['cityId']; if (!Bll_City::isBidCity($cityId)) { throw new Exception_City_NotBidCity('CityId: ' . $cityId); } // 获取竞价房源 $finalProps = array(); $bidProps = Bll_HzBidPlan::get_broker_bidprop($hzBrokerId, $cityId); foreach ($bidProps as $bidProp) { $row = array(); $row['propId'] = $bidProp['proid']; $row['title'] = $bidProp['prop']['content_basic']['title']; $row['imgUrl'] = ''; $row['commId'] = $bidProp['prop']['content_basic']['commid']; $row['commName'] = $bidProp['prop']['content_basic']['commname']; $row['roomNum'] = $bidProp['prop']['content_basic']['roomnum']; $row['hallNum'] = $bidProp['prop']['content_basic']['hallnum']; $row['toiletNum'] = $bidProp['prop']['content_basic']['toilnetnum']; $row['area'] = round($bidProp['prop']['content_basic']['areanum']); $row['price'] = round($bidProp['prop']['content_basic']['pricenum']); $row['priceUnit'] = "元/月"; $row['totalClicks'] = 0; $row['isBid'] = 1; $row['isChoice'] = 0; $row['isVisible'] = (int) ($bidProp['content_basic']['status'] != 6); $row['isMoreImg'] = (int) $bidProp['content_basic']['quality']; $row['isPhonePub'] = (int) (isset($bidProp['content_basic']['from']) && $bidProp['content_basic']['from'] == 'mobile-ajk-broker'); // TODO 批量判定 增加委托房源标签 $isEntrust = Bll_Zufang_Choice::isCommissionHouse($bidProp['proid'], $brokerId, Model_House_Commission::TYPE_RENT); if ($isEntrust) { $row['isEntrust'] = 1; } else { $row['isEntrust'] = 0; } // 确认房源分组 // TODO 基于Rank获取分组可能对页面速度有一定影响 $row['rank'] = $bidProp['rank']; if ($row['rank'] === '已暂停') { $row['group'] = 'offline'; } elseif ($row['rank'] === '排队中') { $row['group'] = 'queued'; } else { $row['group'] = 'online'; } $finalProps[$row['propId']] = $row; } if ($finalProps) { $propIds = array_keys($finalProps); // 批量获取房源的默认图片 $defaultImages = Model_Image_HzImage::getDefaultImagesByHouseIds($propIds); foreach ($defaultImages as $defaultImage) { $finalProps[$defaultImage['proid']]['imgUrl'] = $defaultImage->imageUrl(); } // 批量获取房源的竞价总点击 $bidClicks = Model_Stats_PropClick::getPropAllClicks($propIds, $brokerId, $cityId); $bidClickSums = Model_Stats_PropClick::calculateClickSumsGroupByPropId($bidClicks, 'bid'); foreach ($bidClickSums as $propId => $bidClickSum) { $finalProps[$propId]['totalClicks'] = $bidClickSum; } } // 排序 • 按ID倒序 ksort($finalProps); // 分组 $props = array('onlinePropertyList' => array(), 'queuedPropertyList' => array(), 'offlinePropertyList' => array()); foreach ($finalProps as $finalProp) { switch ($finalProp['group']) { case 'online': $props['onlinePropertyList'][] = $finalProp; break; case 'queued': $props['queuedPropertyList'][] = $finalProp; break; case 'offline': $props['offlinePropertyList'][] = $finalProp; break; } } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $props); }
/** * params brokerid token nameprice comm_id * return rank 排名 */ public function handle_request_internal() { $params = $this->_params; if (!isset($params['brokerId'])) { return Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS); } else { $broker_id = $params["brokerId"]; } if (!isset($params["cityId"])) { return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS); } else { $cityid = $params["cityId"]; } if (!Bll_City::isBidCity($this->_params["cityId"])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $objBLL = new BLL_Property_PropSpread(); $arrRank = array(); $commid = $params['commId']; $act = 'desire'; $propId = $params['propId']; $offer = isset($params['offer']) ? $params['offer'] : 0; $offer = 100 * $offer; $arrPropInfo = $objBLL->getPropInfoBll($propId, $cityid); $priceTotle = $arrPropInfo['PROPRICEINT'] - 0.1; $priceInt = $objBLL->getPriceIntLimit($cityid, $priceTotle, 0, $commid, $arrPropInfo['TRADETYPE'], 1); if ($act == "research") { if (isset($priceInt) && !empty($priceInt)) { $hpratio = isset($params['hpratio']) ? $params['hpratio'] : 0; if ($arrPropInfo['TRADETYPE'] == 1) { $rstRank = $objBLL->getPpcSaleRankBll($propId, $commid, $priceInt['minPrice'], $priceInt['maxPrice'], $hpratio); $arrRank[] = array("minPrice" => $priceInt['minPrice'], "maxPrice" => $priceInt['maxPrice'], "rank" => $rstRank); } } if ($arrRank) { $return = array(); $return["status"] = "ok"; $return["data"] = $arrRank; return $return; } else { return Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR); } } else { // 此处是个坑,客户端不接受-1的值所以取消这个步骤 // $objBLL->jgGuSuan($propId); // if ($rstJgGS) { // APF::get_instance()->get_response()->set_content_type("application/json"); // echo -1; // exit; // } if (isset($priceInt) && !empty($priceInt)) { $commScore = $objBLL->getCommScoreBll($arrPropInfo['COMMID']); if ($arrPropInfo['TRADETYPE'] == 1) { $score = $objBLL->getPropMass($propId, $cityid, $arrPropInfo); $userActionScore = $objBLL->getUserActionScore($propId, $cityid); $hpratio = $objBLL->getHpraio($offer, $score, $userActionScore); } else { $score = $objBLL->getRentQuality($propId, $cityid, $arrPropInfo); $hpratio = $objBLL->getRentHpraio($offer, $score); } if ($arrPropInfo['TRADETYPE'] == 1) { $hpratioNorm = $objBLL->getPpcNormHpratio($hpratio, $arrPropInfo['COMMID'], $propId, false, $arrPropInfo, $priceInt['minPrice'], $priceInt['maxPrice']); $hpratio = round($commScore * $hpratioNorm, 5); $rstRank = $objBLL->getPpcDeseirSaleRankBll($propId, $commid, $priceInt['minPrice'], $priceInt['maxPrice'], $hpratio); $arrRank[] = array("minPrice" => $priceInt['minPrice'], "maxPrice" => $priceInt['maxPrice'], "rank" => $rstRank); } } if ($arrRank) { $return = array(); $return["status"] = "ok"; $return["data"] = $arrRank[0]["rank"]; return $return; } else { return Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR); } } }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; //检查经纪人是否存在 $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $brokerInfo->cityId; if (!Bll_City::isBidCity($cityId)) { throw new Exception_City_NotBidCity('CityId: ' . $cityId); } //从 竞价计划表 找出该经纪人的所有计划 1:推广中 11: 排队中 2:删除 $bidPlans = Model_Plan_EsfAjkPropSpread::getPlanByBroker($brokerId, Model_Plan_EsfAjkPropSpread::DEFAULTVERSION); $data = array('OnlinePropertyList' => array(), 'QueuedPropertyList' => array(), 'OfflinePropertyList' => array()); if (empty($bidPlans)) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data); } $keyedPlans = array(); foreach ($bidPlans as $plan) { $keyedPlans[$plan->propId] = $plan; //key:propId 保存时间 状态 } //房源信息 $propIds = array_keys($keyedPlans); $props = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $brokerInfo->cityId); //批量获取竞价总点击 $bidClickInfo = Model_plan_HpProStatsDay::getPropClicks($propIds, $brokerInfo->cityId); //批量获取图片 $propDefImages = Model_House_AjkPropertyData::getDafImages($propIds); //拼接房源列表中房源数据 $propertyList = array(); foreach ($props as $prop) { $row = array(); $row['propId'] = $prop->proId; $row['title'] = $prop->proName; $row['commId'] = $prop->commId; $row['commName'] = $prop->commName; $row['roomNum'] = $prop->roomNum; $row['hallNum'] = $prop->hallNum; $row['area'] = round($prop->areaNum); $row['toiletNum'] = $prop->toiletNum; $row['price'] = intval($prop->proPrice); $row['priceUnit'] = '万'; $row['isVisible'] = $prop->isHighQulity; $row['isBid'] = 1; $row['isChoice'] = 0; $row['isMoreImg'] = $prop->isHighQulity; $row['isPhonePub'] = $prop->uriCode == 'mobile.asyn' || $prop->uriCode == 'mobile-ajk-broker.asyn' ? 1 : 0; $row['isVisible'] = $prop->isVisible; $row['createTime'] = $keyedPlans[$prop->proId]->createtime; $row['imgUrl'] = $propDefImages[$prop->proId]; if ($prop->commitionType > 1) { $row['isEntrust'] = 1; } else { $row['isEntrust'] = 0; } $row['totalClicks'] = $bidClickInfo[$prop->proId]['totalClicks']; //房源竞价总点击 $propertyList[] = $row; } // 排序 usort($propertyList, function ($a, $b) { if ($a['createTime'] == $b['createTime']) { return 0; } return $a['createTime'] > $b['createTime'] ? -1 : 1; }); // 分组 $onlinePropertyList = array(); //推广中列表 $waitPropertyList = array(); //排队中列表 $offlinePropertyList = array(); //推广结束列表 foreach ($propertyList as $val) { switch ($keyedPlans[$val['propId']]->status) { case '1': $onlinePropertyList[] = $val; break; case '11': $waitPropertyList[] = $val; break; default: $val['isBid'] = 0; $offlinePropertyList[] = $val; } } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('OnlinePropertyList' => $onlinePropertyList, 'QueuedPropertyList' => $waitPropertyList, 'OfflinePropertyList' => $offlinePropertyList)); }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; // 判断经纪人是否存在 $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); $hzBrokerId = Model_Broker_MainBusiness::getHzBrokerIdByAjkBrokerId($brokerId); if (!$hzBrokerId || !$broker) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $broker['cityId']; if (!Bll_City::isBidCity($cityId)) { throw new Exception_City_NotBidCity('CityId: ' . $cityId); } // 获取房源信息 $prop = Model_House_HzProp::findByPropId($propId); /* @var Model_House_HzProp $prop */ if (!$prop) { throw new Exception_Property_NotFound("Zufang propId: {$propId}"); } // TODO 是否需要判断房源是否已删除 // 判断房源是否属于经纪人 if ($prop->getContentBasic('userid') != $hzBrokerId) { throw new Exception_Property_NotFound("Zufang propId: {$propId} not belog to broker: {$brokerId}"); } // 准备默认返回数据(房源未竞价) $data = array('planId' => 0, 'status' => 0, 'rank' => -1, 'rankMsg' => '已暂停', 'todayClicks' => 0, 'totalClicks' => 0, 'clickPrice' => 0, 'clickPriceUnit' => '元', 'minClickPrice' => $prop->getBidMinClickPrice(), 'minClickPriceUnit' => '元', 'budget' => 0, 'budgetUnit' => '元', 'budgetRemain' => 0, 'budgetRemainUnit' => '元'); // 获取竞价计划 $bidPlan = $prop->getBidPlan(); if (!$bidPlan) { // 判断房源是否多图房源 if (!$prop->isMultiImages()) { throw new Exception_Property_NotMultiImages("Zufang propId: {$propId}"); } // TODO 判断是否定价推广(也许可以不用,因为只有从定价推广房源列表点进去的房源详情页才会请求该接口) } else { // 竞价计划ID $data['planId'] = $bidPlan['id']; // 竞价计划状态 switch ($bidPlan['status']) { case Const_HzPlan::SPREAD: $data['status'] = 1; // 推广中 or 排队中 break; case Const_HzPlan::MENUOVER: $data['status'] = 2; // 已暂停 break; } // 竞价预算 $data['budget'] = round($bidPlan['amount'], 2); // 竞价预算余额 $data['budgetRemain'] = round($bidPlan['amount'] - $bidPlan['total_consume'], 2); // 竞价排名 if ($data['status'] == 1) { $data['rank'] = Bll_HzBidPlan::get_bid_rank($prop->getContentBasic(), $cityId); if ($data['rank'] <= 5) { $data['rankMsg'] = ''; } else { $data['rankMsg'] = '排队中'; } } // 竞价点击单价 $bidRelation = $prop->getBidRelation(); $data['clickPrice'] = round($bidRelation['unit_price'], 2); // 竞价点击底价 $data['minClickPrice'] = round($prop->getBidMinClickPrice(), 2); // 今日竞价点击量 $data['todayClicks'] = $prop->getTodayClickSums('bid'); // 竞价点击总量 $data['totalClicks'] = $prop->getTotalClickSums('bid'); } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data); }
/** * @param House_PropviewController $controller * @param AJKRequest $request * @param AJKResponse $response * * @return array */ public static function handlerPropViewRequest($controller, $request, $response) { $routeMatches = $request->get_router_matches(); $houseId = $routeMatches[2]; $cityId = $request->getBrokerCityId(); $brokerId = $request->getBrokerId(); $pageParams = array('houseId' => $houseId); $houseInfo = Bll_House_EsfHouse::getHouseBaseInfoEx($houseId, $cityId); /** 不是当前经纪人的房源则返回到房源管理页去 */ if (empty($houseInfo) || $houseInfo['brokerId'] != $brokerId) { $response->redirect('/ajkbroker/user/manage/proplist/ajk/'); } $pageParams['title'] = $houseInfo['proName']; $houseInfo['mobile'] = $houseInfo['uriCode'] == 'mobile.asyn' || $houseInfo['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0; $pageParams['info'] = sprintf('%s %d平米,%d室%d厅%d卫,%d/%d层,%.2f万 (房源ID:%d)', $houseInfo['commName'], $houseInfo['areaNum'], $houseInfo['roomNum'], $houseInfo['hallNum'], $houseInfo['toiletNum'], $houseInfo['proFloor'], $houseInfo['floorNum'], $houseInfo['proPrice'], $houseId); $currentDate = strtotime(date('Y-m-d 00:00:00')); $postDate = strtotime(date('Y-m-d 00:00:00', $houseInfo['postDate'])); $pageParams['leftDay'] = max(0, 90 - floor(($currentDate - $postDate) / 86400)); $pageParams['houseInfo'] = $houseInfo; $pageParams['viewLink'] = Util_Url::ajkHouseDetailUrl($houseId, $cityId); $pageParams['editURL'] = Bll_Ppc_LinkManager::getSaleEditUrl($houseId); $houseAdShow = Model_House_AdPropShowSale::getHouseAdSale($brokerId, $houseInfo['proId']); $pageParams['AdShow'] = empty($houseAdShow) ? false : true; $pageParams['isIllegal'] = $houseInfo['isVisible'] == 0 && $houseInfo['expireWorker'] != 'propertyReport'; // TODO 获取小区在线房源和排名 需要重构 $pageParams['communitySaleCount'] = Model_Community_AjkSaleRentCount::getCommunitySaleNum($houseInfo['commId']); $isBidCity = Bll_City::isBidCity($cityId); if ($isBidCity) { $pageParams['bidTip'] = '竞价'; } $isChoiceCity = Bll_City::isChoiceCity($cityId); /** 精选城市 */ if ($isChoiceCity) { $pageParams['bidTip'] = '精选'; } $pageParams['isChoiceCity'] = $isChoiceCity; $pageParams['isBidCity'] = $isBidCity; $houseRank = Bll_Broker_Manage_AjkPropList::getHouseSollyResult(array($houseId)); if (isset($houseRank[$houseId])) { $pageParams['houseRank'] = $houseRank[$houseId]; } else { $pageParams['houseRank'] = '待评'; } $houseSpreadDate = array(); for ($interval = -6; $interval <= 0; $interval++) { $houseSpreadDate[] = date('m.d', strtotime("{$interval} day")); } $pageParams['houseSpreadDate'] = $houseSpreadDate; $fixPlanId = Bll_Plan_Fix_AjkPlan::getPlanIdByHouseId($brokerId, $houseId, $cityId); $startDate = date('Ymd', strtotime('-6 day')); $endDate = date('Ymd'); $houseFixDailyCostList = array(); for ($i = -6; $i <= 0; $i++) { $date = date('m.d', strtotime("{$i} day")); $houseFixDailyCostList[$date] = 0; } /** 获取房源指定日期内每天的定价点击 */ if (Bll_Broker_HzBroker::isComboBroker($brokerId)) { $pageParams['houseFixSpreadClickInfoList'] = static::getHouseComboSpreadClickInfo($houseId); } else { $pageParams['houseFixSpreadClickInfoList'] = static::getHouseFixSpreadClickInfoEx($brokerId, $houseId); /** 获取房源指定日期内每天的定价花费 */ $pageParams['houseFixDailyCostList'] = array_merge($houseFixDailyCostList, static::getHouseFixDailyCost($brokerId, $fixPlanId, $houseId, $startDate, $endDate)); } if ($isChoiceCity || $isBidCity) { $houseBidSpreadInfo = static::getHouseBidSpreadInfo($houseId, $cityId); $pageParams['houseBidSpreadInfo'] = $houseBidSpreadInfo; } // $pageParams['houseDetail'] = Bll_Ppc_ServiceAPI::getHouseInfo($houseId); $houseImageInfo = Bll_Ppc_ServiceAPI::getHouseImageInfo($houseId); $pageParams['optimize'] = static::getHouseOptimizeInfo($houseId, $houseImageInfo, $houseInfo, $cityId); $pageParams['imageCount'] = count($houseImageInfo['imageBaseInfo']); if (count($houseImageInfo['imageBaseInfo']) <= 0) { $pageParams['houseDefaultImage'] = 'http://pages.anjukestatic.com/img/global/nopic_150x113.gif'; } else { $pageParams['houseDefaultImage'] = static::getThumbImageUrl($houseId, $houseImageInfo['imageBaseInfo']); } $pageParams['houseStatisticsInfo'] = static::getHouseStatisticsInfo($houseId, $cityId, $houseInfo['commId'], $houseInfo['proPriceInt']); //市场分析,小区价格段供需比。获取前天的数据 $pageParams['demandSupplyPriceInfo'] = static::getDemandSupplyByPriceInfo($houseInfo['commId']); //市场分析,小区户型供需比。获取前天数据 $pageParams['demandSupplyRoomInfo'] = static::getCommTotalRoomInfo($houseInfo['commId']); $pageParams['subRegionRank'] = static::getCommunityRank($houseInfo['areaCode'], $houseInfo['commId']); return $pageParams; }