/** * 暂停竞价 * * @param int $brokerId * @param int $planId * @param int $cityId * @return bool */ public static function stopPlan($brokerId, $planId, $cityId) { if (0 === Model_Plan_EsfAjkPropSpread::stopPlan($brokerId, $planId, $cityId)) { return false; } $planInfo = Model_Plan_EsfAjkPropSpread::getPlanInfoById($planId); // 通知solr下架 BLL_Service_Solr::insertEsfAuctionQueue($planInfo['propId'], 2, $cityId, time()); return true; }
public function deal($propId, $cityId, $time) { //获取房源的定价推广状态 $propSpreadInfo = $this->bll->getPropFixedStatus($propId, $cityId); if ($propSpreadInfo['status'] == 2) { $this->error = "获取房源" . $propId . "的定价推广状态失败"; return false; } //如果正在推广中,插入定价和竞价solr队列 if ($propSpreadInfo['status'] == 1) { if (!BLL_Service_Solr::insertEsfAuctionQueue($propId, 1, $cityId, $time)) { return false; } if (!BLL_Service_Solr::insertEsfAuctionQueue($propId, 1, $cityId, $time)) { return false; } return true; } }
/** * 具体的房源处理 * @param $commChangeInfo */ public function propChange($commChangeInfo) { $time = time(); foreach ($commChangeInfo as $commchange) { $props = $this->bll->getPropByCommId($commchange['community_id'], $commchange['city_id']); if (isset($props[-9999])) { $this->addLogger("获取房源信息失败"); $this->LogQuit(); } if (empty($props)) { $this->addLogger("小区" . $commchange['community_id'] . "下无需处理房源"); continue; } else { $this->addLogger("开始处理小区" . $commchange['community_id'] . "下房源"); } foreach ($props as $prop) { //更新房源areacode if (!$this->bll->updatePropAreacode($prop['proid'], $commchange['city_id'], $commchange['new_block_code'], $time)) { $this->addLogger("二手房更新房源(" . $prop['proid'] . ")areacode失败"); $this->LogQuit(); } else { $this->addLogger("二手房更新房源(" . $prop['proid'] . ")areacode成功"); } if ($prop['tradetype'] == 1) { //PPC //更新定价solr if (!BLL_Service_Solr::insertEsfStaticQueue($prop['proid'], 1, $commchange['city_id'], $time)) { $this->addLogger("二手房更新定价房源(" . $prop['proid'] . ")solr失败"); $this->LogQuit(); } else { $this->addLogger("二手房更新定价房源(" . $prop['proid'] . ")solr成功"); } //更新竞价solr if (!BLL_Service_Solr::insertEsfAuctionQueue($prop['proid'], 1, $commchange['city_id'], $time)) { $this->addLogger("二手房更新竟价房源(" . $prop['proid'] . ")solr失败"); $this->LogQuit(); } else { $this->addLogger("二手房更新竟价房源(" . $prop['proid'] . ")solr成功"); } } elseif ($prop['tradetype'] == 2) { //端口 租房 //更新定价solr if (!BLL_Service_Solr::insertHzStaticQueue($prop['proid'], 1, $commchange['city_id'], $time)) { $this->addLogger("二手房更新端口租房定价房源(" . $prop['proid'] . ")solr失败"); $this->LogQuit(); } else { $this->addLogger("二手房更新端口租房定价房源(" . $prop['proid'] . ")solr成功"); } } else { $this->addLogger("房源(" . $prop['proid'] . ")tradetye异常,为" . $prop['tradetype']); } } } $this->updateDoListStatus(2, "二手房房源更新完成"); }