예제 #1
0
 /**
  * 获取商圈id
  *
  * @param int $cityId
  * @param int $blockId
  * @param int $houseType
  * @return int
  * @throws Exception
  */
 public static function getBusinessCycleId($cityId, $blockId, $houseType)
 {
     $useBusinessCycleConfigOption = array(Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_OFFICE_RENT => 'clues_search_condition_office_rent_list_switch', Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_OFFICE_SALE => 'clues_search_condition_office_sale_list_switch', Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_SHOP_RENT => 'clues_search_condition_shop_rent_list_switch', Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_SHOP_SALE => 'clues_search_condition_shop_sale_list_switch');
     $useBusinessCycleConfig = APF::get_instance()->get_config($useBusinessCycleConfigOption[$houseType], 'jpmulticity');
     $useBusinessCycle = isset($useBusinessCycleConfig[$cityId]) && $useBusinessCycleConfig[$cityId];
     if ($useBusinessCycle) {
         if ($houseType == Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_OFFICE_RENT || $houseType == Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_OFFICE_SALE) {
             return Model_Jinpu_NewBusinessBlockMap::getNewBusinessCycleByOldBlockId($blockId);
         } else {
             return Model_Jinpu_NewShopBusinessBlockMap::getNewBusinessCycleByOldBlockId($blockId);
         }
     }
     return 0;
 }
예제 #2
0
 /**
  * 商铺物业板块变更,处理自选房源
  *
  * @param $cityId
  * @param $oldBlockId
  * @param $newBlockId
  * @param $houseType
  * @param $houseLogType
  * @param $actionType
  * @return array
  * @throws Exception
  */
 public static function dealRoadPropertyAreaChange($cityId, $oldBlockId, $newBlockId, $houseType, $houseLogType, $actionType)
 {
     $useBusinessCycleConfigOption = array(Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_SHOP_RENT => 'clues_search_condition_shop_rent_list_switch', Model_House_JpHouseIdx::ENUM_HOUSE_TYPE_SHOP_SALE => 'clues_search_condition_shop_sale_list_switch');
     $useBusinessCycleConfig = APF::get_instance()->get_config($useBusinessCycleConfigOption[$houseType], 'jpmulticity');
     $useBusinessCycle = isset($useBusinessCycleConfig[$cityId]) && $useBusinessCycleConfig[$cityId];
     if ($useBusinessCycle) {
         $oldBusinessCycleId = Model_Jinpu_NewShopBusinessBlockMap::getNewBusinessCycleByOldBlockId($oldBlockId);
         $choicePlanList = Model_Plan_Jp::getValidChoicePlanByBlockIdAndNewBlockId($oldBlockId, $oldBusinessCycleId, $houseType);
     } else {
         $choicePlanList = Model_Plan_Jp::getValidChoicePlanByBlockIdAndNewBlockId($oldBlockId, 0, $houseType);
     }
     $rtn = array();
     foreach ($choicePlanList as $choicePlan) {
         $houseInfo = Model_House_JpHouseIdx::getHouseInfoById($choicePlan['houseId']);
         if (empty($houseInfo)) {
             $rtn[] = sprintf('没有获取到房源[%d]信息', $choicePlan['houseId']);
             continue;
         }
         if ($houseInfo['isDelete'] != 0) {
             $rtn[] = sprintf('房源[%d]已删除', $choicePlan['houseId']);
             continue;
         }
         $propertyInfo = Model_House_JpProperty::getPropertyById($houseInfo['propertyId']);
         if (empty($propertyInfo)) {
             $rtn[] = sprintf('物业[%d]没有获取到', $houseInfo['propertyId']);
             continue;
         }
         if ($propertyInfo['isRoad'] != 1) {
             $rtn[] = sprintf('物业[%d]非道路型,不处理', $houseInfo['propertyId']);
             continue;
         }
         $houseLog = array();
         $houseLog['houseId'] = $choicePlan['houseId'];
         $houseLog['planId'] = $choicePlan['id'];
         $houseLog['brokerId'] = $choicePlan['ajkBrokerId'];
         $houseLog['cityId'] = $choicePlan['cityId'];
         $houseLog['type'] = $houseLogType;
         $houseLog['changeType'] = $actionType;
         $houseLog['remark'] = sprintf('房源所在物业、写字楼板块发生变更[%d -> %d]', $oldBlockId, $newBlockId);
         $houseLog['addDate'] = date('Y-m-d H:i:s');
         $houseLog['operatorId'] = 0;
         $houseLog['siteType'] = 3;
         if (!Model_Log_HouseLogNew::create($houseLog, date('Ymd'))->save()) {
             $rtn[] = sprintf('板块变更房源[%d]日志写入失败', $choicePlan['houseId']);
             continue;
         }
         $rtn[] = sprintf('板块变更房源[%d]日志写入成功', $choicePlan['houseId']);
     }
     return $rtn;
 }