/**
  * 查询房源的精选(竞价)信息
  *
  * @param $list
  * @return array
  */
 private function getProBidInfo($list)
 {
     static $_cache = array();
     if (isset($_cache[$list['id']])) {
         return $_cache[$list['id']];
     }
     $bidInfo = array();
     //根据房源去查询计划信息
     if ($list['siteType'] == 1) {
         //二手房
         $ajkBidInfo = Model_Plan_AjkPropspread::getAjkPropspreadByProId($list['houseId']);
         if (!empty($ajkBidInfo)) {
             $bidInfo['bidVersion'] = $ajkBidInfo['bidVersion'];
             $bidInfo['bidId'] = $ajkBidInfo['id'];
         }
     } elseif ($list['siteType'] == 2) {
         //租房
         $hzBidId = Model_Plan_HzPlanning::getPropBidPlan($list['houseId']);
         if (!empty($hzBidId)) {
             //查询计划信息
             $hzBidInfo = Model_Plan_HzPlanBasic::get_plan_by_id($hzBidId['plan_id']);
             if (!empty($hzBidInfo) && in_array($hzBidInfo['status'], array(Const_HzPlan::SPREAD, Const_HzPlan::AUTOOVER, Const_HzPlan::MENUOVER, Const_HzPlan::PAUSE, Const_HzPlan::AWAIT, Const_HzPlan::UPPERLIMIT, Const_HzPlan::ENDTIME, Const_HzPlan::WAITING)) || $hzBidInfo['flag'] != 1) {
                 $bidInfo['bidVersion'] = $hzBidInfo['bid_version'];
                 $bidInfo['bidId'] = $hzBidInfo['id'];
             }
         }
     } elseif ($list['siteType'] == 3) {
         //金铺
         $jpBidInfo = Model_Plan_Jp::getBidPlanByHouseIdV2($list['houseId']);
         if (!empty($jpBidInfo)) {
             $bidInfo['bidVersion'] = $jpBidInfo->bidVersion;
             $bidInfo['bidId'] = $jpBidInfo->id;
         }
     }
     $_cache[$list['id']] = $bidInfo;
     return $bidInfo;
 }
Exemplo n.º 2
0
 /**
  * 房源更新到solr
  * @param int $intRequestKey 请求类型 1-房源编号 2-推广编号 3-经纪人编号
  * @param int $intRequestVal 请求类型对应的值
  * @param int $intStatus 操作状态:1-更新(房源),2-预约 (房源),3-删除 (房源),4-手动推广开始(推广计划),
  *                      5-手动推广结束(推广计划),6-日预算花完(定价推广),7-余额花完停止(定价推广),
  *                      8-预算花完停止 (竞价推广),9-推广周期结束停止(竞价推广),10-经纪人房源下线
  * @return int
  */
 public static function updateHouseToSolr($intRequestKey, $intRequestVal, $intStatus)
 {
     if ($intRequestKey == 1) {
         $jpBidInfo = Model_Plan_Jp::getBidPlanByHouseIdV2($intRequestVal);
         //非套餐城市通知老队列
         $ComboConfig = DAO_My_ComboConfig::getComboConfigByCityId($jpBidInfo->cityId);
         if ($ComboConfig && $ComboConfig['type'] == 0) {
             return true;
         }
         $objDa = new Model_House_UpDown_SolrJinpu();
         $objDa->houseId = $intRequestVal;
         $objDa->status = 1;
         $objDa->createTime = date('Y-m-d H:i:s');
         return $objDa->save();
     } else {
         if ($intRequestKey == 2) {
             $objDa = new Model_Plan_JpSpreadStatusUpdate();
             $objDa->spread_id = $intRequestVal;
             $objDa->status = $intStatus - 3;
             $objDa->create_time = date('Y-m-d H:i:s');
             return $objDa->save();
         } else {
             if ($intRequestKey == 3) {
                 $objDa = new Model_Plan_JpSpreadBrokerUpdate();
                 $objDa->member_id = $intRequestVal;
                 $objDa->status = $intStatus == 10 ? 1 : 2;
                 $objDa->create_time = date('Y-m-d H:i:s');
                 $objDa->save();
             }
         }
     }
 }