private function noticeComboSolrJpAPI($record, $flag, $from = Bll_Combo_NoticeSolrUpDown::HLSFromComboUpDown) { $houseIdx = Model_House_JpHouseIdx::data_access()->filter('id', $record['houseId'])->find_only(); if (intval($houseIdx->houseType) <= 0) { $this->setLog('金铺房源房源类型为空,无法处理 '); return false; } $res = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($record['cityId'], $record['brokerId'], $record['houseId'], $houseIdx->houseType, $flag, $from, strtotime($record['addDate']), date('Ymd', strtotime($record['addDate'])) . $record['id']); $this->setLog('通知solr res: ' . json_encode($res)); return $res; }
public function dealTask($solrOnProId) { if ($onlineComboRelation = Bll_Combo_HouseRelation::getOnlineRelationByHouseId($solrOnProId, Bll_Combo_HouseRelation::SITE_TYPE_JP)) { printf('房源 %s 已经在套餐推广中, 不用通知solr下' . PHP_EOL, $solrOnProId); return true; } // 房源没有或者不在线 通知solr下 //Bll_House_JpHouseInfo::updateHouseToSolr(1, $solrOnProId, 1); $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($this->cityId, $onlineComboRelation['brokerId'], $solrOnProId, 1, 2, Bll_Combo_NoticeSolrUpDown::HLSFromComboCheckNotice); printf('房源 %s 没有在套餐推广中, 需要通知solr下' . PHP_EOL, $solrOnProId); printf('房源 %s 通知中间件返回的结果status=%s ; message=%s' . PHP_EOL, $solrOnProId, $result['status'], $result['message']); return true; }
/** * 判断该task的房子 不在线则通知上 * @param $task * @return bool * @throws Exception */ public function dealTask($task) { $houseInfo = $task; $proId = $houseInfo['id']; $cityId = $houseInfo['cityId']; $brokerInfo = Model_Broker_JpBroker::data_access()->filter('id', $houseInfo['memberId'])->get_row(); //查询城市配置信息 $ComboConfig = DAO_My_ComboConfig::getComboConfigByCityId($cityId); // 判断solr是否在线 不在线通知上 if ($ComboConfig && $ComboConfig['type'] == 0) { //套餐城市 if (Bll_Combo_HouseRelation::getOnlineRelationByHouseId($proId, Bll_Combo_HouseRelation::SITE_TYPE_JP)) { $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($cityId, $brokerInfo['ajkMemberId'], $proId, $houseInfo['houseType'], 1); $this->setLog(sprintf('房源 %s 通知中间件返回的结果status=%s ; message=%s' . PHP_EOL, $proId, $result['status'], $result['message'])); $this->setLog(sprintf('房源 %s 在套餐推广中, 需要通知solr上' . PHP_EOL, $proId)); return true; } return true; } else { //ppc城市 if ($houseInfo['fixSpreadId'] != 0) { $spreadInfo = Model_Plan_Jp::data_access()->filter('id', $houseInfo['fixSpreadId'])->filter('type', Model_Plan_Jp::ENUM_TYPE_FIX)->filter('isDelete', Model_Plan_Jp::ENUM_IS_DELETE_NO)->get_row(); if ($spreadInfo && $spreadInfo['status'] == 2) { // 定价在线 需要通知上 $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($cityId, $brokerInfo['ajkMemberId'], $proId, $houseInfo['houseType'], 1); $this->setLog(sprintf('房源 %s 通知中间件返回的结果status=%s ; message=%s' . PHP_EOL, $proId, $result['status'], $result['message'])); $this->setLog(sprintf('房源 %s 在定价推广中, 需要通知solr上' . PHP_EOL, $proId)); return true; } } return true; } }
public function dealTask($solrOnProId) { $houseInfo = Model_House_JpHouseIdx::data_access()->filter('id', $solrOnProId)->get_row(); $brokerInfo = Model_Broker_JpBroker::data_access()->filter('id', $houseInfo['memberId'])->get_row(); if ($houseInfo['isDelete'] == 1) { if ($this->dealFlag) { $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($this->cityId, $brokerInfo['ajkMemberId'], $solrOnProId, $houseInfo['houseType'], 2); $this->setLog(sprintf('房源 %s 通知中间件返回的结果status=%s ; message=%s' . PHP_EOL, $solrOnProId, $result['status'], $result['message'])); } $this->setLog(sprintf('房源 %s 已经删除, 需要通知solr下' . PHP_EOL, $solrOnProId)); return true; } //查询城市配置信息 $ComboConfig = DAO_My_ComboConfig::getComboConfigByCityId($houseInfo['cityId']); if ($ComboConfig && $ComboConfig['type'] == 0) { //套餐城市 if (!Bll_Combo_HouseRelation::getOnlineRelationByHouseId($solrOnProId, Bll_Combo_HouseRelation::SITE_TYPE_JP)) { if ($this->dealFlag) { $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($this->cityId, $brokerInfo['ajkMemberId'], $solrOnProId, $houseInfo['houseType'], 2); $this->setLog(sprintf('房源 %s 通知中间件返回的结果status=%s ; message=%s' . PHP_EOL, $solrOnProId, $result['status'], $result['message'])); } $this->setLog(sprintf('房源 %s 不在套餐推广中, 需要通知solr下' . PHP_EOL, $solrOnProId)); return true; } return true; } else { //ppc城市 if ($houseInfo['spreadId'] != 0) { $spreadInfo = Model_Plan_Jp::data_access()->filter('id', $houseInfo['spreadId'])->filter('type', Model_Plan_Jp::ENUM_TYPE_FIX)->filter('isDelete', Model_Plan_Jp::ENUM_IS_DELETE_NO)->get_row(); if ($spreadInfo && $spreadInfo['status'] == 2) { return true; } } if ($this->dealFlag) { $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($this->cityId, $brokerInfo['ajkMemberId'], $solrOnProId, $houseInfo['houseType'], 2); $this->setLog(sprintf('房源 %s 通知中间件返回的结果status=%s ; message=%s' . PHP_EOL, $solrOnProId, $result['status'], $result['message'])); } $this->setLog(sprintf('房源 %s 不在定价推广中, 需要通知solr下' . PHP_EOL, $solrOnProId)); return true; } }
private function noticeComboSolr($memberId, $houseId, $houseType) { $brokerInfo = Model_Broker_JpBroker::getBrokerInfoById($memberId, array('cityId', 'ajkMemberId')); if (empty($brokerInfo)) { $this->logMsg(sprintf('获取经纪人[%d]信息失败[houseId - %d - %d]', $memberId, $houseId, $houseType)); return; } $result = Bll_Combo_NoticeSolrUpDown::noticeComboSolrJpAPI($brokerInfo['cityId'], $brokerInfo['ajkMemberId'], $houseId, $houseType, self::NOTICE_SOLR_ACTION, self::NOTICE_SOLR_FROM, time(), date('YmdHis') . $houseId); $this->logMsg(sprintf('通知房源[%d - %d]solr下架,result: %s', $houseId, $houseType, json_encode($result))); }