Example #1
0
 public static function extendChoiceInfo($fixHouseList, $choiceHouseList, $cityId)
 {
     $priceSegmentList = Model_House_EsfPrice::getAllPriceInterval($cityId, Model_House_EsfPrice::TRADE_TYPE_SALE);
     // TODO 附加精选相关的信息 精选链接 精选提示
     foreach ($fixHouseList as $houseId => &$houseInfo) {
         $houseInfo['choiceNotice'] = '';
         if (isset($choiceHouseList[$houseId])) {
             $houseInfo['bidStatus'] = $choiceHouseList[$houseId]['status'];
             if ($choiceHouseList[$houseId]['status'] == 1) {
                 $houseInfo['bidUrl'] = '/ajkbroker/user/choice/manage/ajk/#' . $houseId;
                 $houseInfo['choiceNotice'] = '已精选';
                 continue;
             } elseif ($choiceHouseList[$houseId]['status'] == 11) {
                 $houseInfo['bidUrl'] = '/ajkbroker/user/choice/manage/ajk/#' . $houseId;
                 $houseInfo['choiceNotice'] = '排队中';
                 continue;
             } else {
                 if ($choiceHouseList[$houseId]['status'] != 2) {
                     $houseInfo['bidUrl'] = "/ajkbroker/user/choice/set/ajk/" . $houseInfo['proId'] . '/?act=1&rebid=1&plan_id=' . $choiceHouseList[$houseId]['id'];
                 }
                 $houseInfo['choiceNotice'] = $houseInfo['expiredDay'] >= 75 ? '可精选' : '';
             }
         }
         if (!$houseInfo['isHighQulity']) {
             continue;
         }
         if ($houseInfo['expiredDay'] < 75) {
             continue;
         }
         $houseInfo['choiceNotice'] = '可精选';
         foreach ($priceSegmentList as $priceSegment) {
             $housePrice = $houseInfo['proPrice'] * 10000;
             if ($priceSegment['minPrice'] < $housePrice && $housePrice <= $priceSegment['maxPrice']) {
                 $houseInfo['proPriceId'] = $priceSegment['id'];
                 break;
             }
         }
         $bucketInfo = Bll_Choice_EsfBidBucket::getBucketInfo($houseInfo['commId'], $houseInfo['cityId'], $houseInfo['proPriceId']);
         // $bucketInfo = Bll_Choice_EsfBidBucket::get_bucket_info($houseInfo['commId'], $houseInfo['cityId'], $houseInfo['proPriceInt']);
         if (false === $bucketInfo || empty($bucketInfo)) {
             continue;
         }
         if ($bucketInfo['usedNum'] == $bucketInfo['totalNum']) {
             $houseInfo['choiceNotice'] = '已排满';
         } elseif ($bucketInfo['usedNum'] < $bucketInfo['totalNum'] && $bucketInfo['usedNum'] >= $bucketInfo['maxOnlineNum']) {
             $houseInfo['choiceNotice'] = '可排队';
         } else {
             $houseInfo['choiceNotice'] = '可精选';
         }
     }
     return $fixHouseList;
 }
Example #2
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     //经纪人信息
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     if (!Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         throw new Exception_ISNotComboBrokerException('不是套餐经纪人。');
     }
     // 套餐信息
     $comboInfoList = Bll_Combo_Broker_BrokerComboInfo::getBrokerComboList($brokerId);
     $currentDate = time();
     foreach ($comboInfoList as $comboInfo) {
         $startDate = strtotime($comboInfo['startTime']);
         $endDate = strtotime($comboInfo['endTime']);
         // 获取当前使用的套餐
         if ($currentDate >= $startDate && $currentDate < $endDate && $comboInfo['salePropNum'] + $comboInfo['rentPropNum'] > 0) {
             $currentCombo = $comboInfo;
             $comboPropNum = $currentCombo['salePropNum'];
             if (Bll_Combo_Broker_BrokerComboInfo::isOpenUp($currentCombo)) {
                 $comboPropNum = $currentCombo['rentPropNum'] + $currentCombo['salePropNum'];
             }
             break;
         }
     }
     $hasCombo = 0;
     //没有二手房套餐
     if (!isset($currentCombo)) {
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('list' => array(), 'surplus' => 0, 'hasCombo' => $hasCombo));
     } else {
         $hasCombo = 1;
     }
     $cityId = $brokerInfo->cityId;
     //获取套餐推广信息
     $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerId, $cityId);
     if (Bll_Combo_Broker_BrokerComboInfo::isOpenUp($currentCombo)) {
         $currentSpreadHouseCount = Bll_Combo_HouseRelation::getHouseCount($brokerId, Bll_Combo_Broker_BrokerComboInfo::SITE_TYPE_AJK, true);
     } else {
         $currentSpreadHouseCount = Bll_Combo_HouseRelation::getHouseCountEx($brokerId, $cityId, Bll_Combo_Broker_BrokerComboInfo::SITE_TYPE_AJK);
     }
     //套餐还可以推的房源数量
     $surplus = $comboPropNum - $currentSpreadHouseCount;
     if (empty($comboSpreadHouseList)) {
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('list' => array(), 'surplus' => $surplus, 'hasCombo' => $hasCombo));
     }
     //获取房源信息
     $propIds = array_keys($comboSpreadHouseList);
     $propsInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId);
     //批量获取默认图片
     $propDefImages = Model_House_AjkPropertyData::getDafImages($propIds);
     //批量获取房源总点
     $houseTodayClickInfo = Bll_House_EsfHouse::getHouseTodayComboClick($propIds);
     $houseClickInfo = Bll_House_EsfHouse::getComboHouseAccumulateClickByPropIds($brokerId, $propIds, $cityId);
     //房源竞价&精选计划
     $propSpreadInfo = Model_Plan_EsfAjkPropSpread::getPlanByPropIds($propIds);
     // 获取城市价格段信息
     $priceSegmentList = Model_House_EsfPrice::getAllPriceInterval($cityId, Model_House_EsfPrice::TRADE_TYPE_SALE);
     //是否是精选城市,是否精选分离
     $cityIsChoice = Bll_City::isChoiceCity($cityId, Const_Site::ANJUKE);
     $cityIsChoiceIndependent = Bll_City::isChoiceIndependentCity($cityId, Const_Site::ANJUKE);
     //拼接房源列表中房源数据
     $list = array();
     foreach ($propsInfo as $prop) {
         $row = array();
         $row['propId'] = $prop->proId;
         $row['title'] = $prop->proName;
         $row['commId'] = $prop->commId;
         $row['commName'] = $prop->commName;
         $row['roomNum'] = $prop->roomNum;
         $row['hallNum'] = $prop->hallNum;
         $row['area'] = round($prop->areaNum);
         $row['toiletNum'] = $prop->toiletNum;
         $row['price'] = intval($prop->proPrice);
         $row['priceUnit'] = '万';
         $row['isBid'] = 0;
         $row['isChoice'] = 0;
         $row['isMoreImg'] = $prop->isHighQulity;
         $row['isPhonePub'] = $prop->uriCode == 'mobile.asyn' || $prop->uriCode == 'mobile-ajk-broker.asyn' ? 1 : 0;
         $row['isVisible'] = isset($houseInfo['isVisible']) ? $houseInfo['isVisible'] : 1;
         //0-违规房源 1-非违规房源
         $row['createTime'] = $prop->postDate;
         //房源发布时间
         $row['imgUrl'] = Model_House_AjkPropertyData::imageUrl($propDefImages[$prop->proId]);
         if ($prop->commitionType == 2) {
             $row['isEntrust'] = 1;
         } else {
             $row['isEntrust'] = 0;
         }
         $row['totalClicks'] = $houseTodayClickInfo[$prop->proId] + $houseClickInfo[$prop->proId];
         if (isset($propSpreadInfo[$prop->proId])) {
             if ($propSpreadInfo[$prop->proId]->bidVersion == 1 && ($propSpreadInfo[$prop->proId]->status == 1 || $propSpreadInfo[$prop->proId]->status == 11)) {
                 $row['isBid'] = 1;
             } elseif ($propSpreadInfo[$prop->proId]->bidVersion == 2 && ($propSpreadInfo[$prop->proId]->status == 1 || $propSpreadInfo[$prop->proId]->status == 11)) {
                 $row['isChoice'] = 1;
             }
         }
         $choiceStatusRecommend = Bll_House_EsfHouse::getEsfChoiceStatusAndRecommend($priceSegmentList, $propSpreadInfo, $prop, $cityIsChoice, $cityIsChoiceIndependent);
         $row['choiceStatus'] = $choiceStatusRecommend['choiceStatus'];
         $row['choiceStatusName'] = $choiceStatusRecommend['choiceStatusName'];
         $row['choiceRecommend'] = $choiceStatusRecommend['choiceRecommend'];
         $list[] = $row;
     }
     // 排序
     usort($list, function ($a, $b) {
         if ($a['createTime'] == $b['createTime']) {
             return 0;
         }
         return $a['createTime'] > $b['createTime'] ? -1 : 1;
     });
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('list' => $list, 'surplus' => $surplus > 0 ? $surplus : 0, 'hasCombo' => $hasCombo));
 }
Example #3
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'];
     }
     //优先说明  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), ''));
 }
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     if (!Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         throw new Exception_ISNotComboBrokerException('不是套餐经纪人。');
     }
     //获取套餐推广信息
     $cityId = $brokerInfo->cityId;
     $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerId, $cityId);
     $comboSpreadHouseIds = array_keys($comboSpreadHouseList);
     //获取精选推广信息
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     $choiceHouseList = $bll->getBrokerPropChoiceInfo($brokerId);
     $choiceHouseIds = array();
     foreach ($choiceHouseList as $list) {
         foreach ($list as $v) {
             $choiceHouseIds[] = $v['propId'];
         }
     }
     //获取经纪人所有房源信息
     $tempHouseInfoList = Bll_House_EsfHouse::getBrokerAllPropInfoList($brokerId, $cityId);
     if (empty($tempHouseInfoList)) {
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array()));
     }
     //未推广房源列表
     $tempNoSpreadHouseList = array();
     $noSpreadHouseIds = array();
     foreach ($tempHouseInfoList as $houseInfo) {
         if (!in_array($houseInfo['proId'], $comboSpreadHouseIds) && !in_array($houseInfo['proId'], $choiceHouseIds)) {
             $houseInfo['illegal'] = isset($houseInfo['isVisible']) ? $houseInfo['isVisible'] : 1;
             //0-违规房源 1-非违规房源
             $tempNoSpreadHouseList[$houseInfo['proId']] = $houseInfo;
             $noSpreadHouseIds[] = $houseInfo['proId'];
         }
     }
     // 获取城市价格段信息
     $priceSegmentList = Model_House_EsfPrice::getAllPriceInterval($cityId, Model_House_EsfPrice::TRADE_TYPE_SALE);
     /** 过滤违规房源 */
     $tmpIllegalList = array();
     if (!$noSpreadHouseIds) {
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => array()));
     }
     foreach ($tempNoSpreadHouseList as $propId => $houseInfo) {
         if ($houseInfo['illegal'] == 0 && $houseInfo['expireWorker'] != 'propertyReport') {
             $tmpIllegalList[$propId] = $houseInfo;
             unset($tempNoSpreadHouseList[$propId]);
         }
     }
     //是否是精选城市,是否精选分离
     $cityIsChoice = Bll_City::isChoiceCity($cityId, Const_Site::ANJUKE);
     $cityIsChoiceIndependent = Bll_City::isChoiceIndependentCity($cityId, Const_Site::ANJUKE);
     //违规房源排在前面
     $noSpreadHouseList = array_merge($tmpIllegalList, $tempNoSpreadHouseList);
     $propDefImages = Model_House_AjkPropertyData::getDafImages($noSpreadHouseIds);
     $propertyList = array();
     foreach ($noSpreadHouseList as $houseInfo) {
         $row = array();
         $row['propId'] = $houseInfo['proId'];
         $row['title'] = $houseInfo['proName'];
         $row['commId'] = $houseInfo['commId'];
         $row['commName'] = $houseInfo['commName'];
         $row['roomNum'] = $houseInfo['roomNum'];
         $row['hallNum'] = $houseInfo['hallNum'];
         $row['area'] = round($houseInfo['areaNum']);
         $row['toiletNum'] = $houseInfo['toiletNum'];
         $row['price'] = intval($houseInfo['proPrice']);
         $row['priceUnit'] = '万';
         $row['isBid'] = 0;
         $row['isChoice'] = 0;
         $row['isMoreImg'] = $houseInfo['isHighQulity'];
         $row['isPhonePub'] = $houseInfo['uriCode'] == 'mobile.asyn' || $houseInfo['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
         $row['isVisible'] = $houseInfo['illegal'];
         //0-违规房源 1-非违规房源
         $row['createTime'] = $houseInfo['postDate'];
         //房源发布时间
         $row['imgUrl'] = $row['imgUrl'] = Model_House_AjkPropertyData::imageUrl($propDefImages[$houseInfo['proId']]);
         if ($houseInfo['commitionType'] == 2) {
             $row['isEntrust'] = 1;
         } else {
             $row['isEntrust'] = 0;
         }
         //精选状态: 可精选;可排队;精选中;排队中
         $choiceStatusRecommend = Bll_House_EsfHouse::getEsfChoiceStatusAndRecommend($priceSegmentList, array(), $houseInfo, $cityIsChoice, $cityIsChoiceIndependent);
         $row['choiceStatus'] = $choiceStatusRecommend['choiceStatus'];
         $row['choiceStatusName'] = $choiceStatusRecommend['choiceStatusName'];
         $row['choiceRecommend'] = $choiceStatusRecommend['choiceRecommend'];
         $propertyList[] = $row;
     }
     //排序
     usort($propertyList, function ($a, $b) {
         if ($a['createTime'] == $b['createTime']) {
             return 0;
         }
         return $a['createTime'] > $b['createTime'] ? -1 : 1;
     });
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('propertyList' => $propertyList));
 }
Example #5
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), ''));
 }