/** * 通知solr处理 * * <ol> * <li> * 当房源日志type为房源更新(4),房源推广(5),第二天推广(7)时,通知solr更新 * </li> * <li> * 当房源日志type为房源删除(3),取消推广(6),取消第二天推广(12)时,通知solr删除 * </li> * <li> * 通知solr的展示时间为job当时查到的计划的viewtime * </li> * </ol> */ public function noticeSolrAjk($record) { $type = $record['type']; if ($type == 4 || $type == 5 || $type == 7) { $updateType = 1; //add } elseif ($type == 6 || $type == 12) { $updateType = 2; //delete } else { //记录处理日志 $this->setLog('不需要做solr处理' . __METHOD__); return true; } $planId = $record['planId']; //获取计划的viewtime $planInfo = Model_Plan_EsfFixedPlan::data_access()->filter_by_op('id', '=', $planId)->find_only(); if (empty($planInfo)) { //记录处理日志 $this->setLog(sprintf('计划[%d]信息为空,不做solr处理', $planId)); return true; } $resArr = Bll_Combo_NoticeSolrUpDown::noticePpcSolrAjkAPI($record['cityId'], $record['brokerId'], $record['houseId'], $updateType, $planInfo->viewtime, $planId, Bll_Combo_NoticeSolrUpDown::HLSFromPpcUpDown, strtotime($record['addDate']), date('Ymd', strtotime($record['addDate'])) . $record['id']); if ($resArr['status'] != 'ok') { $this->setLog(sprintf('计划[%d],solr处理失败 res:' . json_encode($resArr), $planId)); return false; } $this->setLog(sprintf('计划[%d],solr处理成功 res:' . json_encode($resArr), $planId)); return true; }