Beispiel #1
0
 public function handle_request_internal()
 {
     $request = APF::get_instance()->get_request();
     $managerCookie = $request->get_cookie('manager_id');
     if (!empty($managerCookie)) {
         echo json_encode(array('status' => 'error', 'data' => '没有操作权限。'));
         return;
     }
     $houseIds = $request->get_parameter('houseIds');
     $planId = $request->get_parameter('planId');
     if (is_null($houseIds)) {
         echo json_encode(array('status' => 'error', 'data' => '请输入房源ID'));
         return;
     }
     $houseIds = explode(',', $houseIds);
     $houseBaseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx(static::$intBrokerID, $houseIds, static::$intBrokerCityID, array('proId'));
     if (empty($houseBaseInfoList)) {
         echo json_encode(array('status' => 'error', 'data' => '获取房源信息失败'));
         return;
     }
     $houseIdList = array();
     foreach ($houseBaseInfoList as $houseBaseInfo) {
         $houseIdList[] = $houseBaseInfo['proId'];
     }
     $result = Bll_Ppc_ServiceAPI::fixPlanAddHouse(static::$intBrokerID, $houseIdList, $planId, 21181);
     if ($result && strcasecmp('ok', $result['status']) == 0) {
         echo json_encode(array('status' => 'ok', 'data' => '推广成功'));
     } elseif ($result && strcasecmp('error', $result['status']) == 0) {
         echo json_encode(array('status' => 'error', 'data' => $result['info']));
     } else {
         echo json_encode(array('status' => 'ok', 'data' => '推广成功', 'msg' => '调用API超时'));
     }
 }
Beispiel #2
0
 public function handle_request_internal()
 {
     /**
      * @var $request AJKRequest
      */
     $request = APF::get_instance()->get_request();
     $houseIds = $request->get_parameter('houseIds');
     if (!is_array($houseIds)) {
         $houseIds = explode(',', $houseIds);
     }
     if (empty($houseIds)) {
         echo '{"status":"error"}';
         return;
     }
     $cityId = $request->getBrokerCityId();
     $houseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx(static::$intBrokerID, $houseIds, $cityId, array('proId', 'brokerId', 'cityId'));
     if (empty($houseInfoList) || count($houseInfoList) != count($houseIds)) {
         echo '{"status":"error"}';
         return;
     }
     if (Bll_Broker_HzBroker::isComboBroker(static::$intBrokerID)) {
         if (Bll_House_EsfHouse::deleteHouseCombo(static::$intBrokerID, $cityId, $houseIds)) {
             echo '{"status":"ok"}';
             return;
         }
     } else {
         if (Bll_House_EsfHouse::deleteHouse(static::$intBrokerID, $cityId, $houseIds)) {
             echo '{"status":"ok"}';
             return;
         }
     }
     echo '{"status":"error"}';
 }
Beispiel #3
0
 /**
  * 去除那些不属于经纪人的房源
  *
  * @param int $brokerId
  * @param string|array $houseIds
  * @param int $cityId
  * @return array
  */
 private function removeInvalidateHouseId($brokerId, $houseIds, $cityId)
 {
     $houseIds = is_array($houseIds) ? $houseIds : explode(',', $houseIds);
     $houseList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx($brokerId, $houseIds, $cityId, array('proId', 'expireWorker', 'isVisible'));
     if (empty($houseList)) {
         return array();
     }
     $realHouseIds = array();
     foreach ($houseList as $houseInfo) {
         if ($houseInfo['isVisible'] == 0 && $houseInfo['expireWorker'] != 'propertyReport') {
             continue;
         }
         $realHouseIds[] = $houseInfo['proId'];
     }
     return $realHouseIds;
 }
Beispiel #4
0
 /**
  * 获取套餐房源的累计点击量
  *
  * @param int $brokerId
  * @param array|int $houseIds
  * @param int $cityId
  * @return array
  */
 public static function getComboHouseAccumulateClick($brokerId, $houseIds, $cityId)
 {
     $noCacheHouseIds = is_array($houseIds) ? $houseIds : array($houseIds);
     /**
      * 从memcache里获取房源累计点击信息
      */
     $cache = APF_Cache_Factory::get_instance()->get_memcache();
     $cacheKey = sprintf('combo_accumulate_house_click_1_%d', $brokerId);
     /**
      * Memcache::get 的用法
      * @link http://php.net/manual/zh/memcache.get.php
      */
     $cacheHouseAccumulateClickList = $cache->get($cacheKey);
     if (is_array($cacheHouseAccumulateClickList) && !empty($cacheHouseAccumulateClickList)) {
         $houseAccumulateClickList = $cacheHouseAccumulateClickList;
         $cacheHouseIds = array_keys($cacheHouseAccumulateClickList);
         $noCacheHouseIds = array_diff($noCacheHouseIds, $cacheHouseIds);
     } else {
         $houseAccumulateClickList = array_fill_keys($noCacheHouseIds, 0);
     }
     if (count($noCacheHouseIds) == 0) {
         return $houseAccumulateClickList;
     }
     foreach ($noCacheHouseIds as $noCacheHouseId) {
         $houseAccumulateClickList[$noCacheHouseId] = 0;
     }
     $houseIds = $noCacheHouseIds;
     /**
      * 获取房源的发布时间
      */
     $houseBaseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx($brokerId, $houseIds, $cityId, array('proId', 'postDate'));
     if (empty($houseBaseInfoList)) {
         return $houseAccumulateClickList;
     }
     /**
      * 根据房源的发布时间获取房源累计点击量的分表后缀
      */
     $splitSuffixes = array();
     foreach ($houseBaseInfoList as $houseBaseInfo) {
         $splitSuffix = date('Ym', $houseBaseInfo['postDate']);
         if (!isset($splitSuffixes[$splitSuffix])) {
             $splitSuffixes[$splitSuffix] = array();
         }
         $splitSuffixes[$splitSuffix][] = $houseBaseInfo['proId'];
     }
     if (empty($splitSuffixes)) {
         return $houseAccumulateClickList;
     }
     /**
      * 获取房源的累计点击量
      */
     $result = array();
     foreach ($splitSuffixes as $splitSuffix => $houseIdList) {
         $houseClickInfoList = Model_Broker_ComboPropClickAccumulate::getHouseClickInfo($houseIdList, Model_Broker_ComboPropClickAccumulate::SITE_TYPE_AJK, $splitSuffix);
         $result = array_merge($result, $houseClickInfoList);
     }
     if (empty($result)) {
         return $houseAccumulateClickList;
     }
     /**
      * 生成房源累计点击量信息
      */
     foreach ($result as $houseAccumulateClickInfo) {
         $houseId = $houseAccumulateClickInfo['propId'];
         $houseAccumulateClickList[$houseId] = $houseAccumulateClickInfo['vppvAccumulate'];
     }
     $cache->set($cacheKey, $houseAccumulateClickList, 0, 7200);
     return $houseAccumulateClickList;
 }
 public function handle_request_internal()
 {
     /**
      * @var $request AJKRequest
      */
     $request = APF::get_instance()->get_request();
     /**
      * @var $response AJKResponse
      */
     $response = APF::get_instance()->get_response();
     $response->set_content_type('application/json', 'utf-8');
     $houseIds = $request->get_parameter('houseIds');
     if (empty($houseIds)) {
         echo json_encode($this->buildResponse('error', null, '请输入房源ID'));
         return;
     }
     if (!is_array($houseIds)) {
         $houseIds = explode(',', $houseIds);
     }
     $brokerId = static::$intBrokerID;
     $cityId = static::$intBrokerCityID;
     if (!Bll_City::isChoiceCity($cityId)) {
         echo json_encode($this->buildResponse('error', null, '只有精选城市才有这个功能'));
         return;
     }
     /**  获取房源信息 */
     $tempHouseBaseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx($brokerId, $houseIds, $cityId, array('proId', 'commId', 'proPriceId', 'proPrice', 'isVisible', 'isHighQulity', 'postDate'));
     /** 过滤掉不能精选的房源 */
     $houseBaseInfoList = $this->filterCanChoiceHouseList($tempHouseBaseInfoList);
     if (empty($houseBaseInfoList)) {
         echo json_encode($this->buildResponse('error', null, '没有获取到房源信息'));
         return;
     }
     /** 房源的精选推广状态 */
     $houseChoiceStateList = $this->initHouseChoiceState($houseIds);
     /** 获取城市价格段信息 */
     $priceSegmentList = Model_House_EsfPrice::getAllPriceInterval($cityId, Model_House_EsfPrice::TRADE_TYPE_SALE);
     if (empty($priceSegmentList)) {
         echo json_encode($this->buildResponse('error', null, '获取城市房源价格段信息失败'));
         return;
     }
     /** 修正房源价格段ID, 对房源按小区和价格段ID分组 */
     $groupCommunityPriceSegmentList = $this->groupCommunityPriceSegment($houseBaseInfoList, $priceSegmentList);
     /** 获取坑位信息  */
     $bucketInfoList = array();
     foreach ($groupCommunityPriceSegmentList as $key => $propIds) {
         list($communityId, $priceId) = explode('_', $key);
         $bucketInfo = Bll_Choice_EsfBidBucket::getBucketInfo($communityId, $cityId, $priceId);
         $bucketInfoList[$key] = $bucketInfo['usedNum'] < $bucketInfo['maxOnlineNum'];
     }
     //优先说明  3=低价 2=促销 1=推荐  低价>促销(折扣)>推荐(主营、热门、抢置顶)
     $brokerMarkHouseIds = $this->initBrokerMarkHouse($groupCommunityPriceSegmentList, $bucketInfoList);
     $result = array();
     foreach ($houseIds as $key => $houseId) {
         if (!isset($brokerMarkHouseIds[$houseId])) {
             continue;
         }
         $reasonStr = '';
         // from来源初始化
         $query = array('from' => '');
         if ($brokerMarkHouseIds[$houseId]['type'] == 1) {
             //推荐房源
             $query['from'] = 'recommendsite';
             if (!empty($brokerMarkHouseIds[$houseId]['rc_reason'])) {
                 switch ($brokerMarkHouseIds[$houseId]['rc_reason']) {
                     case 1:
                         $reasonStr = '主营小区';
                         break;
                     case 2:
                         $reasonStr = '热门小区';
                         break;
                     case 3:
                         $reasonStr = '精选即可置顶';
                         break;
                     case 4:
                         $reasonStr = '主营、热门小区';
                         break;
                     case 5:
                         $reasonStr = '主营、精选即可置顶';
                         break;
                     case 6:
                         $reasonStr = '热门、精选即可置顶';
                         break;
                     case 7:
                         $reasonStr = '主营、热门、精选即可置顶';
                         break;
                 }
             }
         } elseif ($brokerMarkHouseIds[$houseId]['type'] == 2) {
             //促销房源
             $query['from'] = 'promotionsite';
             if (!empty($brokerMarkHouseIds[$houseId]['zhekou'])) {
                 $zk = $brokerMarkHouseIds[$houseId]['zhekou'] / 10;
                 $reasonStr = '限时降价' . $zk . '折';
             } else {
                 $reasonStr = '限时降价';
             }
         } elseif ($brokerMarkHouseIds[$houseId]['type'] == 3) {
             //低价房源
             $query['from'] = 'lowpricesite';
             $reasonStr = '价格便宜';
         }
         if ($houseChoiceStateList[$houseId] > 0) {
             $query['act'] = 1;
             $query['rebid'] = 1;
             $query['plan_id'] = $houseChoiceStateList[$houseId];
         }
         $result[$key] = array('id' => $houseId, 'url' => sprintf('/ajkbroker/user/choice/set/ajk/%d/?%s', $houseId, http_build_query($query)), 'recommend' => $brokerMarkHouseIds[$houseId]['type']);
         $result[$key]['reason'] = $reasonStr;
     }
     if (count($result) > 15) {
         $resultSlice = array_slice($result, 0, 15);
     } else {
         $resultSlice = $result;
     }
     foreach ($resultSlice as $key => $val) {
         if ($houseChoiceStateList[$val['id']] == -1) {
             unset($resultSlice[$key]);
         }
     }
     $params = array();
     foreach ($resultSlice as $key => $val) {
         if ($brokerMarkHouseIds[$val['id']]['type'] == 1) {
             //推荐房源
             $rcReason = $brokerMarkHouseIds[$val['id']]['rc_reason'];
         } elseif ($brokerMarkHouseIds[$val['id']]['type'] == 2) {
             //促销房源
             $rcReason = '折扣';
         } elseif ($brokerMarkHouseIds[$val['id']]['type'] == 3) {
             //低价房源
             $rcReason = '';
         }
         $params[] = array('brokerId' => $brokerId, 'cityId' => $cityId, 'proId' => $val['id'], 'type' => $val['recommend'], 'rcReason' => $rcReason, 'createTime' => $brokerMarkHouseIds[$val['id']]['createTime']);
     }
     if (!empty($params)) {
         $params = json_encode($params);
         APF::get_instance()->get_nlogger()->log('brokerMark', $params, true);
     }
     echo json_encode($this->buildResponse('ok', array_values($resultSlice), ''));
 }
Beispiel #6
0
 public function handle_request_internal()
 {
     /**
      * @var $request AJKRequest
      */
     $request = APF::get_instance()->get_request();
     /**
      * @var $response AJKResponse
      */
     $response = APF::get_instance()->get_response();
     $response->set_content_type('application/json', 'utf-8');
     $houseIds = $request->get_parameter('houseIds');
     if (empty($houseIds)) {
         echo json_encode($this->buildResponse('error', null, '请输入房源ID'));
         return;
     }
     if (!is_array($houseIds)) {
         $houseIds = explode(',', $houseIds);
     }
     $brokerId = static::$intBrokerID;
     $cityId = static::$intBrokerCityID;
     if (!Bll_City::isChoiceCity($cityId)) {
         echo json_encode($this->buildResponse('error', null, '只有精选城市才有这个功能'));
         return;
     }
     /**  获取房源信息 */
     $tempHouseBaseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx($brokerId, $houseIds, $cityId, array('proId', 'commId', 'proPriceId', 'proPrice', 'isVisible', 'isHighQulity', 'postDate'));
     /** 过滤掉不能精选的房源 */
     $houseBaseInfoList = $this->filterCanChoiceHouseList($tempHouseBaseInfoList);
     if (empty($houseBaseInfoList)) {
         echo json_encode($this->buildResponse('error', null, '没有获取到房源信息'));
         return;
     }
     /** 房源的精选推广状态 */
     $houseChoiceStateList = $this->initHouseChoiceState($houseIds);
     /** 获取城市价格段信息 */
     $priceSegmentList = Model_House_EsfPrice::getAllPriceInterval($cityId, Model_House_EsfPrice::TRADE_TYPE_SALE);
     if (empty($priceSegmentList)) {
         echo json_encode($this->buildResponse('error', null, '获取城市房源价格段信息失败'));
         return;
     }
     /** 修正房源价格段ID, 对房源按小区和价格段ID分组 */
     $groupCommunityPriceSegmentList = $this->groupCommunityPriceSegment($houseBaseInfoList, $priceSegmentList);
     /** 获取坑位休息  */
     $bucketInfoList = array();
     foreach ($groupCommunityPriceSegmentList as $key => $propIds) {
         list($communityId, $priceId) = explode('_', $key);
         $bucketInfo = Bll_Choice_EsfBidBucket::getBucketInfo($communityId, $cityId, $priceId);
         $bucketInfoList[$key] = $bucketInfo['usedNum'] < $bucketInfo['maxOnlineNum'];
     }
     //优先说明,一元精选 > 抢置顶 > 最划算
     /** 一元精选房源 */
     $unitaryHouseIds = $this->initUnitaryHouse($groupCommunityPriceSegmentList, $bucketInfoList);
     /** 抢置顶房源 */
     $topHouseIds = $this->initTopHouse($groupCommunityPriceSegmentList, $bucketInfoList);
     /** 最划算房源 */
     $cheapestHouseIds = $this->initCheapestHouse($groupCommunityPriceSegmentList, $bucketInfoList);
     //合并数据 + 数组的值去重
     $unitaryTopCheapHouseIds = array_unique(array_merge($unitaryHouseIds, $cheapestHouseIds, $topHouseIds));
     $result = array();
     foreach ($unitaryTopCheapHouseIds as $HouseId) {
         if ($houseChoiceStateList[$HouseId] == -1) {
             continue;
         }
         // recommend、from来源初始化
         $query = array('from' => '');
         $recommend = -1;
         if (in_array($HouseId, $unitaryHouseIds)) {
             //一元精选房源
             $query['from'] = 'unitarysite';
             $recommend = 3;
         } elseif (in_array($HouseId, $topHouseIds)) {
             //抢置顶房源
             $query['from'] = 'topsite';
             $recommend = 1;
         } elseif (in_array($HouseId, $cheapestHouseIds)) {
             //最划算房源
             $query['from'] = 'cheapsite';
             $recommend = 2;
         }
         if ($houseChoiceStateList[$HouseId] > 0) {
             $query['act'] = 1;
             $query['rebid'] = 1;
             $query['plan_id'] = $houseChoiceStateList[$HouseId];
         }
         $result[] = array('id' => $HouseId, 'url' => sprintf('/ajkbroker/user/choice/set/ajk/%d/?%s', $HouseId, http_build_query($query)), 'recommend' => $recommend);
     }
     echo json_encode($this->buildResponse('ok', array_values($result), ''));
 }
Beispiel #7
0
 /**
  * 502 经纪人套餐生效
  *
  * @param $queueInfo
  * @return array
  */
 public static function comboEffect($queueInfo)
 {
     $dealRemark = array();
     $currentCombo = Bll_Combo_Broker_BrokerComboInfo::getBrokerCurrentCombo($queueInfo['broker_id'], Bll_Combo_Broker_BrokerComboInfo::SITE_TYPE_AJK);
     $onlineHouseRelationList = Bll_Combo_HouseRelation::getOnlineHouseList($queueInfo['broker_id'], $queueInfo['city_id'], Bll_Combo_HouseRelation::SITE_TYPE_AJK);
     /** 当前没有生效的套餐,下掉所有的房子 */
     if (empty($currentCombo)) {
         $dealRemark[] = sprintf('%d 经纪人当前[%s]没有生效的租售套餐', $queueInfo['id'], date('Y-m-d H:i:s'));
         $data = static::buildHouseLog($queueInfo, 21, '经纪人套餐生效,未获取到套餐信息房源下架', 0);
         if (!empty($onlineHouseRelationList)) {
             foreach ($onlineHouseRelationList as $onlineHouseRelation) {
                 $data['houseId'] = $onlineHouseRelation['houseId'];
                 if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) {
                     $dealRemark[] = sprintf('%d 套餐生效,未获取到套餐信息,下掉房源(%d) 失败', $queueInfo['id'], $onlineHouseRelation['houseId']);
                     continue;
                 }
                 $dealRemark[] = sprintf('%d 套餐生效,未获取到套餐信息,下掉房源(%d) 成功', $queueInfo['id'], $onlineHouseRelation['houseId']);
             }
         }
         return static::buildReturn(self::PROCESS_STATUS_SUCCESS, $dealRemark);
     }
     /** 添加打通的套餐的逻辑 */
     if (Bll_Combo_Broker_BrokerComboInfo::isOpenUp($currentCombo)) {
         $dealRemark[] = '当前套餐为打通套餐';
         $comboSpreadHouseCount = $currentCombo['salePropNum'] + $currentCombo['rentPropNum'];
         $hzHouseOnlineRelationList = Bll_Combo_HouseRelation::getOnlineHouseList($queueInfo['broker_id'], $queueInfo['city_id'], Bll_Combo_HouseRelation::SITE_TYPE_HZ);
         $spreadHouseCount = count($hzHouseOnlineRelationList) + count($onlineHouseRelationList);
         if ($spreadHouseCount >= $comboSpreadHouseCount) {
             $dealRemark[] = sprintf('%d 经纪人当前[%s]套餐,可推广房源数小于当前在线房源数,不处理。', $queueInfo['id'], date('Y-m-d H:i:s'));
             return static::buildReturn(self::PROCESS_STATUS_SUCCESS, $dealRemark);
         }
         /** 上架房源 */
         $needSpreadHouseCount = $comboSpreadHouseCount - $spreadHouseCount;
         $hzExpiredHouseRelationList = Bll_Combo_HouseRelation::getHouseRelations($queueInfo['broker_id'], Bll_Combo_HouseRelation::SITE_TYPE_HZ, Model_Combo_HouseRelation::ENUM_COMBO_EXPIRE);
         $ajkExpiredHouseRelationList = Bll_Combo_HouseRelation::getHouseRelations($queueInfo['broker_id'], Bll_Combo_HouseRelation::SITE_TYPE_AJK, Model_Combo_HouseRelation::ENUM_COMBO_EXPIRE);
         $rangedHouseRelation = Bll_Combo_Updown_AjkDealJob::calculateRangeByCreated($ajkExpiredHouseRelationList, $hzExpiredHouseRelationList);
         /** 过滤无效房源 */
         $validateHouseRelation = array();
         foreach ($rangedHouseRelation as $houseRelation) {
             $houseId = $houseRelation['houseId'];
             if ($houseRelation['siteType'] == Bll_Combo_HouseRelation::SITE_TYPE_HZ) {
                 $houseInfo = Model_House_HzPropSearch::get_prop_by_prop_id($queueInfo['city_id'], $houseId);
                 if (empty($houseInfo)) {
                     $dealRemark[] = sprintf('好租房源[%d]不存在', $houseId);
                     continue;
                 }
                 if (in_array($houseInfo['status'], array(Const_HzStatus::VERIFY, Const_HzStatus::REMOVE, Const_HzStatus::EXPIRED))) {
                     $dealRemark[] = sprintf('好租房源[%d]不是有效的房源', $houseId);
                     continue;
                 }
                 $validateHouseRelation[] = $houseRelation;
                 continue;
             }
             $houseInfo = Bll_House_EsfHouse::getHouseBaseInfoEx($houseId, $queueInfo['city_id']);
             if (empty($houseInfo)) {
                 $dealRemark[] = sprintf('二手房房源[%d]不是有效的房源', $houseId);
                 continue;
             }
             if ($houseInfo['isVisible'] == 0 && $houseInfo['expireWorker'] != 'propertyReport') {
                 $dealRemark[] = sprintf('二手房房源(%d)违规,不做处理', $houseId);
                 continue;
             }
             $validateHouseRelation[] = $houseRelation;
         }
         $houseUpRelationList = array_slice($validateHouseRelation, 0, $needSpreadHouseCount);
         $data = static::buildHouseLog($queueInfo, 20, '经纪人套餐生效,房源上架', 0);
         foreach ($houseUpRelationList as $onlineHouseRelation) {
             $site = $onlineHouseRelation['siteType'] == Bll_Combo_HouseRelation::SITE_TYPE_AJK ? '二手房' : '好租';
             if (1 == Model_Combo_HouseRelation::updateHouseComboSpreadStateEx($queueInfo['broker_id'], $queueInfo['city_id'], $onlineHouseRelation['houseId'], Model_Combo_HouseRelation::ENUM_HOUSE_ONLINE, $onlineHouseRelation['siteType'])) {
                 $dealRemark[] = sprintf('上架' . $site . '房源[%d]成功', $onlineHouseRelation['houseId']);
             } else {
                 $dealRemark[] = sprintf('上架' . $site . '房源[%d]失败', $onlineHouseRelation['houseId']);
             }
             $data['houseId'] = $onlineHouseRelation['houseId'];
             $data['siteType'] = $onlineHouseRelation['siteType'] == Bll_Combo_HouseRelation::SITE_TYPE_AJK ? 1 : 2;
             if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) {
                 $dealRemark[] = sprintf('%d 套餐生效,上架' . $site . '房源(%d) 失败', $queueInfo['id'], $onlineHouseRelation['houseId']);
                 continue;
             }
             $dealRemark[] = sprintf('%d 套餐生效,上架' . $site . '房源(%d) 成功', $queueInfo['id'], $onlineHouseRelation['houseId']);
         }
         $dealRemark[] = sprintf('%d [%s] 经纪人套餐生效,上架%d套房源。', $queueInfo['id'], date('Y-m-d H:i:s'), $spreadHouseCount);
         return static::buildReturn(self::PROCESS_STATUS_SUCCESS, $dealRemark);
     }
     /**
      * 下掉超出限制的房源
      */
     if (count($onlineHouseRelationList) >= $currentCombo['salePropNum']) {
         $data = static::buildHouseLog($queueInfo, 21, '经纪人套餐生效,下掉多余房子', 0);
         $offLineHouseList = array_slice($onlineHouseRelationList, $currentCombo['salePropNum']);
         if (empty($offLineHouseList)) {
             return static::buildReturn(self::PROCESS_STATUS_SUCCESS, sprintf('%d [%s] 经纪人在线房源数已经达到套餐限制[%d]。', $queueInfo['id'], date('Y-m-d H:i:s'), $currentCombo['salePropNum']));
         }
         foreach ($offLineHouseList as $offLineHouse) {
             $data['houseId'] = $offLineHouse['houseId'];
             if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) {
                 $dealRemark[] = sprintf('%d 套餐生效,未获取到套餐信息,下掉房源(%d) 失败', $queueInfo['id'], $offLineHouse['houseId']);
                 continue;
             }
             $dealRemark[] = sprintf('%d 套餐生效,未获取到套餐信息,下掉房源(%d) 成功', $queueInfo['id'], $offLineHouse['houseId']);
         }
         return static::buildReturn(self::PROCESS_STATUS_SUCCESS, $dealRemark);
     }
     $expiredHouseRelationList = Bll_Combo_HouseRelation::getHouseRelations($queueInfo['broker_id'], Bll_Combo_HouseRelation::SITE_TYPE_AJK, Model_Combo_HouseRelation::ENUM_COMBO_EXPIRE);
     if (empty($expiredHouseRelationList)) {
         return static::buildReturn(self::PROCESS_STATUS_SUCCESS, sprintf('%d [%s] 没有获取到经纪人因套餐到期而下架的房源。', $queueInfo['id'], date('Y-m-d H:i:s')));
     }
     $expiredHouseRelationIds = array();
     foreach ($expiredHouseRelationList as $expiredHouseRelation) {
         $expiredHouseRelationIds[] = $expiredHouseRelation['houseId'];
     }
     $houseInfoList = Bll_House_EsfHouse::getHouseInfoByHouseIdEx($queueInfo['broker_id'], $expiredHouseRelationIds, $queueInfo['city_id'], array('proId', 'expireWorker', 'isVisible'));
     if (empty($houseInfoList)) {
         return static::buildReturn(self::PROCESS_STATUS_SUCCESS, sprintf('%d [%s] 没有获取到房源(%s)信息。', $queueInfo['id'], date('Y-m-d H:i:s'), implode(',', $expiredHouseRelationIds)));
     }
     /** 过滤掉违规房源 */
     $validateHouseIds = array();
     foreach ($houseInfoList as $houseInfo) {
         if ($houseInfo['isVisible'] == 0 && $houseInfo['expireWorker'] != 'propertyReport') {
             $dealRemark[] = sprintf('房源(%d)违规,不做处理', $houseInfo['proId']);
             continue;
         }
         $validateHouseIds[] = $houseInfo['proId'];
     }
     /** 按照房源ID 排序 */
     sort($validateHouseIds, SORT_NUMERIC);
     if (count($validateHouseIds) > $currentCombo['salePropNum']) {
         $onlineHouseIds = array_slice($validateHouseIds, count($validateHouseIds) - $currentCombo['salePropNum']);
     } else {
         $onlineHouseIds = $validateHouseIds;
     }
     $data = static::buildHouseLog($queueInfo, 20, '经纪人套餐生效,房源上架', 0);
     foreach ($onlineHouseIds as $onlineHouseId) {
         $data['houseId'] = $onlineHouseId;
         if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) {
             $dealRemark[] = sprintf('%d 套餐生效,上架房源(%d) 失败', $queueInfo['id'], $onlineHouseId);
             continue;
         }
         $dealRemark[] = sprintf('%d 套餐生效,上架房源(%d) 成功', $queueInfo['id'], $onlineHouseId);
     }
     $spreadHouseCount = Model_Combo_HouseRelation::updateHouseComboSpreadStateEx($queueInfo['broker_id'], $queueInfo['city_id'], $onlineHouseIds, Model_Combo_HouseRelation::ENUM_HOUSE_ONLINE, Bll_Combo_HouseRelation::SITE_TYPE_AJK);
     $dealRemark[] = sprintf('%d [%s] 经纪人套餐生效,上架%d套房源[%s]。', $queueInfo['id'], date('Y-m-d H:i:s'), $spreadHouseCount, implode(',', $onlineHouseIds));
     return static::buildReturn(self::PROCESS_STATUS_SUCCESS, $dealRemark);
 }