Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 /**
  * 房源价格变更(房源日志发起)
  * 重新计算价格段
  * 如果:价格不变更,则:不处理。
  * 如果:价格段变更,则:停止竞价(过程参照手动停止)
  * 维护坑位表(-1)
  * 更新计划为停止状态
  * 通知solr下(停止的房源)
  * 记录房源日志(停止的房源)
  * 根据停止的房源,取出坑位里面的推广、排队房源
  * 计算排名
  * 更新计划状态(坑位里面的异动房源更新状态)
  * 通知solr(坑位里面的异动房源通知solr)
  * 记房源日志(坑位里面的房源异动日志)
  * 房源价格变更(房源日志发起)
  * @param array $params
  * @return array|bool
  */
 public static function changeProPrice($params = array())
 {
     // 检查参数
     $checkParams = self::checkParams($params);
     if (!$checkParams['status']) {
         return $checkParams;
     }
     // 获取信息,组装$params
     $joinParams = self::joinParams($params);
     if (!$joinParams['status']) {
         return $joinParams;
     }
     if (!($priceBlock = Bll_HzBidPlan::get_price_block($params['cityId'], $params['newPrice']))) {
         return Bll_HzPropBll::build_return(0, array('获取价格区间段失败'));
     }
     if ($priceBlock['ID'] == $params['priceId']) {
         return Bll_HzPropBll::build_return(1, array('价格区间段没变'));
     }
     // 下线
     $toStop = self::stopChoiceSpread(array('planId' => $params['planId'], 'brokerId' => $params['ajkBrokerId'], 'type' => 406), 'job');
     if (!$toStop['status']) {
         return $toStop;
     }
     return Bll_HzPropBll::build_return(1, $toStop['msg']);
 }
Exemplo n.º 3
0
 /**
  * 计算竞价房源排名
  * @param $proId
  * @param $commId
  * @param $priceNum
  * @param $unitPrice
  * @param $cityId
  * @return int
  */
 public static function getBidRank($proId, $commId, $priceNum, $unitPrice, $cityId)
 {
     // 获取价格段
     $priceBlock = Bll_HzBidPlan::get_price_block($cityId, $priceNum);
     // 板块id
     $ajkid = Bll_HzProp::get_subregion_id($commId, $proId);
     $rank = Util_SearchUtil::getHpCurrentRank($cityId, $ajkid, $proId, $priceBlock['LOWER'], $priceBlock['UPPER'], $unitPrice);
     if ($rank > 5) {
         $rank = '排队中';
     }
     return $rank;
 }