示例#1
0
 public function handle_request()
 {
     if (empty($this->cityid)) {
         return;
     }
     $brokers = array();
     $dao = Model_Plan_AjkPropspread::data_access();
     if ($this->brokerid) {
         $dao->filter('brokerId', $this->brokerid);
     }
     $dao->filter('cityId', $this->cityid);
     $dao->filter('status', array(1, 11));
     $datas = $dao->find();
     foreach ($datas as $data) {
         if (isset($brokers[$data['brokerId']])) {
             continue;
         }
         $result = Uri_Curl::get($this->url . 'user/broker/transformmoney', array('id' => $data['brokerId'], 'status' => 5));
         printf('[%s]开始处理二手房: 城市ID为%s的历史数据,brokerId为 %s,处理结果:%s' . PHP_EOL, date('Y-m-d H:i:s'), $data['cityId'], $data['brokerId'], $result);
         $brokers[$data['brokerId']] = 1;
     }
 }
示例#2
0
 public function handle_request_internal()
 {
     // TODO: Implement handle_request_internal() method.
     $result['status'] = 'ok';
     $cityId = $this->_params['cityId'];
     $brokerId = $this->_params['brokerId'];
     $relations = Model_Plan_AjkFixRelation::getRelationListByPlanId($this->_params['planId'], $cityId);
     $propertyList = array('newList' => array(), 'oldList' => array());
     if (!empty($relations)) {
         $propIds = array();
         foreach ($relations as $row) {
             $propIds[] = $row['proId'];
         }
         $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId, array('postDate' => 'desc'));
         //房源点击量
         $proClickDao = new DAO_My_Ppc_PlanOpe();
         $proClickInfo = $proClickDao->getProClick($propIds, strtotime("20120901"));
         $spreads = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propIds);
         if (!empty($spreads)) {
             foreach ($spreads as $row) {
                 $spreadArr[$row['propId']]['bidVersion'] = $row['bidVersion'];
                 $spreadArr[$row['propId']]['status'] = $row['status'];
             }
         }
         foreach ($houseInfo as $row) {
             $propId = $row['proId'];
             $list['propId'] = $propId;
             $list['title'] = $row['proName'];
             $list['commId'] = $row['commId'];
             $list['commName'] = $row['commName'];
             $list['roomNum'] = $row['roomNum'];
             $list['hallNum'] = $row['hallNum'];
             $list['toiletNum'] = $row['toiletNum'];
             $list['area'] = round($row['areaNum']);
             $list['price'] = is_float($row['proPrice']) ? round($row['proPrice'], 1) : $row['proPrice'];
             $list['priceUnit'] = '万';
             $list['totalClicks'] = isset($proClickInfo[$propId]) ? $proClickInfo[$propId] : 0;
             $list['isBid'] = $list['isChoice'] = 0;
             if (isset($spreadArr) && isset($spreadArr[$propId])) {
                 if ($spreadArr[$propId]['bidVersion'] == 1 && $spreadArr[$propId]['status'] == 1) {
                     $list['isBid'] = 1;
                 } elseif ($spreadArr[$propId]['bidVersion'] == 2 && ($spreadArr[$propId]['status'] == 1 || $spreadArr[$propId]['status'] == 11)) {
                     $list['isChoice'] = 1;
                 }
             }
             $list['isMoreImg'] = $row['isHighQulity'];
             $list['isVisible'] = $row['isVisible'];
             $list['isPhonePub'] = $row['uriCode'] == 'mobile.asyn' || $row['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
             $list['createTime'] = $row['postDate'];
             $imgBll = Bll_Image_EsfHouseImage::getInstance();
             $list['imgUrl'] = $imgBll->getThumbImageUrl($propId, $row['commId']);
             //增加委托房源标签
             if ($row['commitionType'] == 2) {
                 $list['isEntrust'] = 1;
             } else {
                 $list['isEntrust'] = 0;
             }
             //计算出房源推广天数
             $timeFixStr = strtotime(date("Ymd", $row['postDate']));
             $leftDay = floor((time() - $timeFixStr) / 86400);
             if ($leftDay >= 30) {
                 $propertyList['oldList'][] = $list;
             } else {
                 $propertyList['newList'][] = $list;
             }
         }
     }
     $result['data'] = $propertyList;
     return $result;
 }
示例#3
0
 function getComboPropsInOneComm($brokerId, $cityId, $commId = '')
 {
     $base_domain = APF::get_instance()->get_config('base_domain');
     //获取套餐推广信息
     $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerId, $cityId);
     if (empty($comboSpreadHouseList)) {
         return array();
     } else {
         //获取房源信息
         $propIds = array_keys($comboSpreadHouseList);
         $propsInfo = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId);
     }
     //房源计划形态(是精选还是竞价)
     $spreads = array();
     if ($propIds) {
         $spreads = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propIds);
     }
     if (!empty($spreads)) {
         foreach ($spreads as $row) {
             $spreadArr[$row['propId']]['bidVersion'] = $row['bidVersion'];
             $spreadArr[$row['propId']]['status'] = $row['status'];
         }
     }
     foreach ($propsInfo as $propArr) {
         $propId = $propArr['proId'];
         $commProps[$propArr['commId']][$propId]['id'] = $propId;
         $commProps[$propArr['commId']][$propId]['title'] = $propArr['proName'];
         $commProps[$propArr['commId']][$propId]['commId'] = $propArr['commId'];
         $commProps[$propArr['commId']][$propId]['commName'] = $propArr['commName'];
         $commProps[$propArr['commId']][$propId]['roomNum'] = $propArr['roomNum'];
         $commProps[$propArr['commId']][$propId]['hallNum'] = $propArr['hallNum'];
         $commProps[$propArr['commId']][$propId]['toiletNum'] = $propArr['toiletNum'];
         $commProps[$propArr['commId']][$propId]['area'] = $propArr['areaNum'];
         $commProps[$propArr['commId']][$propId]['price'] = $propArr['proPrice'];
         $commProps[$propArr['commId']][$propId]['priceUnit'] = '万';
         $commProps[$propArr['commId']][$propId]['isVisible'] = $propArr['isVisible'];
         $commProps[$propArr['commId']][$propId]['imgUrl'] = 'http://pages.anjukestatic.com/img/global/nopic_100x75.gif';
         $commProps[$propArr['commId']][$propId]['isMoreImg'] = $propArr['isHighQulity'] ? 1 : 0;
         $commProps[$propArr['commId']][$propId]['isPhonePub'] = $propArr['uriCode'] == 'mobile.asyn' || $propArr['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
         $commProps[$propArr['commId']][$propId]['propUrl'] = 'http://' . $base_domain . '/web/sale/x/' . $propArr['cityId'] . '/' . $propId;
         $commProps[$propArr['commId']][$propId]['createTime'] = date('Y-m-d H:i:s', $propArr['postDate']);
         $commProps[$propArr['commId']][$propId]['totalClicks'] = isset($proClickInfo[$propId]) ? $proClickInfo[$propId] : 0;
         $commProps[$propArr['commId']][$propId]['isBid'] = $commProps[$propArr['commId']][$propId]['isChoice'] = 0;
         if (isset($spreadArr) && isset($spreadArr[$propId])) {
             if ($spreadArr[$propId]['bidVersion'] == 1 && $spreadArr[$propId]['status'] == 1) {
                 $commProps[$propArr['commId']][$propId]['isBid'] = 1;
             } elseif ($spreadArr[$propId]['bidVersion'] == 2 && ($spreadArr[$propId]['status'] == 1 || $spreadArr[$propId]['status'] == 11)) {
                 $commProps[$propArr['commId']][$propId]['isChoice'] = 1;
             }
         }
         $imgBll = Bll_Image_EsfHouseImage::getInstance();
         $commProps[$propArr['commId']][$propId]['imgUrl'] = $imgBll->getThumbImageUrl($propId, $propArr['commId']);
     }
     $return = $commProps;
     if ($commId) {
         $ret['status'] = 'ok';
         $ret['data']['propertyList'] = $return[$commId] ? array_values($return[$commId]) : array();
     } else {
         $ret = $return;
     }
     return $ret;
 }
示例#4
0
 public function handle_request_internal()
 {
     header("Access-Control-Allow-Origin: *");
     $propId = $this->_params['propId'];
     //好丑陋。。。。。。好无奈。。。。。。
     //委托房源自动转发停用,为了app能够展示报错信息。。。
     if (empty($propId)) {
         $this->_params['apiDebug'] = 1;
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => '0000', 'message' => '委托房源自动转发功能已停用;若要发布请手动发布');
     }
     $propInfo = Bll_Ppc_ServiceAPI::getHouseInfo($propId);
     $brokerId = $this->_params['brokerId'];
     $houseInfo = Model_House_EsfHouseElementFactory::getHouseBaseInfo($propId);
     if (empty($houseInfo)) {
         $cityId = Model_Broker_AjkBrokerExtend::getCityIdByBrokerId($this->_params['brokerId']);
         $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propId, $cityId);
     }
     if (!empty($houseInfo)) {
         $result['status'] = 'ok';
         $areaCode = $houseInfo['areaCode'];
         $block = Bll_Commtype_Api::getInfoByTypeCode($areaCode);
         $area = Bll_Commtype_Api::getInfoByTypeId($block['parentId']);
         $area_name = $area['typeName'];
         $block_name = $block['typeName'];
         $data['title'] = $houseInfo['proName'];
         $data['commId'] = $houseInfo['commId'];
         $data['commName'] = $houseInfo['commName'];
         //小区信息
         $commInfo = Bll_Community_APIComm::getInstance()->getInfoByIdMapping($data['commId'], 2);
         $data['commLocation'] = $commInfo['commLocal'];
         $data['sosolat'] = $commInfo['sosolat'];
         //纬度
         $data['sosolng'] = $commInfo['sosolng'];
         //经度
         $data['floor'] = $propInfo['property']['ProFloor'];
         $data['totalFloor'] = $propInfo['property']['FloorNum'];
         $propDescription = $propInfo['property']['sale']['AddExplan'];
         $propDescription = str_replace('<p>', "", $propDescription);
         $propDescription = str_replace('</p>', "", $propDescription);
         $propDescription = trim($propDescription);
         $data['propDescription'] = $propDescription;
         $data['areaname'] = $area_name;
         $data['blockname'] = $block_name;
         $data['roomNum'] = $houseInfo['roomNum'];
         $data['hallNum'] = $houseInfo['hallNum'];
         $data['toiletNum'] = $houseInfo['toiletNum'];
         $data['area'] = $houseInfo['areaNum'];
         $data['areaUnit'] = '平米';
         $data['price'] = $houseInfo['proPrice'];
         $data['priceUnit'] = '万';
         $data['isMoreImg'] = $houseInfo['isHighQulity'];
         $data['isVisible'] = $houseInfo['isVisible'];
         $data['isPhonePub'] = $houseInfo['uriCode'] == 'mobile.asyn' || $houseInfo['uriCode'] == 'mobile-ajk-broker.asyn' ? 1 : 0;
         $data['propImagesUrl'] = array();
         $data['propImages'] = $data['outdoorImage'] = array();
         if ($propInfo['attachments']['attachments']) {
             $propImageNum = 0;
             $outdoorImageNum = 0;
             $images = $propInfo['attachments']['attachments'];
             foreach ($images as $image) {
                 if ($image['DataType'] == 2) {
                     if ($propImageNum >= 8) {
                         continue;
                     }
                     $imageInfo = array();
                     $url = Util_ImageUtils::getResizeURL($image['FileName'], $image['host_id'], 600, 600);
                     $url = str_replace("display", "display/e", $url);
                     $imageInfo['bigImageUrl'] = $url;
                     $data['propImages'][] = $imageInfo;
                     $propImageNum += 1;
                 } else {
                     if ($image['DataType'] == 3) {
                         if ($outdoorImageNum >= 1) {
                             continue;
                         }
                         $imageInfo = array();
                         $url = Util_ImageUtils::getResizeURL($image['FileName'], $image['host_id'], 600, 600);
                         $url = str_replace("display", "display/e", $url);
                         $imageInfo['bigImageUrl'] = $url;
                         $data['outdoorImage'][] = $imageInfo;
                         $outdoorImageNum += 1;
                     }
                 }
             }
         }
         $spread = Model_Plan_AjkPropspread::getAjkPropSpreadByIds($propId);
         $data['isChoice'] = $data['isBid'] = 0;
         if (!empty($spread)) {
             if ($spread[0]['bidVersion'] == 1 && $spread[0]['status'] == 1) {
                 $data['isBid'] = 1;
             } elseif ($spread[0]['bidVersion'] == 2 && ($spread[0]['status'] == 1 || $spread[0]['status'] == 11)) {
                 $data['isChoice'] = 1;
             }
         }
         //计算出房源推广天数
         $timeFixStr = strtotime(date("Ymd", $houseInfo['postDate']));
         $leftDay = floor((time() - $timeFixStr) / 86400);
         $data['publishDaysMsg'] = $leftDay > 0 ? $leftDay . '天前发布' : '今天发布';
         $imgBll = Bll_Image_EsfHouseImage::getInstance();
         $data['imgUrl'] = $imgBll->getThumbImageUrl($propId, $houseInfo['commId']);
         $mobileBaseDomain = APF::get_instance()->get_config("mobile_base_domain");
         $data['url'] = 'http://' . $mobileBaseDomain . '/sale/x/' . $houseInfo['cityId'] . '/' . $houseInfo->proId;
         //增加委托房源标签
         if ($houseInfo['commitionType'] == 2) {
             $data['isEntrust'] = 1;
         } else {
             $data['isEntrust'] = 0;
         }
     } else {
         $data['status'] = 'error';
         $data['message'] = '房源信息不存在';
     }
     $result['data'] = $data;
     return $result;
 }
 /**
  * 二手房小区合并
  *
  * @param array $houseLog
  */
 private function ajkCommunityMerge($houseLog)
 {
     if ($houseLog['type'] != Const_ProLogType::LOG_COMMUNITY_MERGE || $houseLog['siteType'] != 1) {
         $this->setLog(sprintf('房源日志类型[%d]错误/不是二手房[%d]房源日志', $houseLog['type'], $houseLog['siteType']));
         return;
     }
     $choicePlanInfo = Model_Plan_AjkPropspread::getAjkPropspreadByProId($houseLog['houseId']);
     if (empty($choicePlanInfo)) {
         $this->setLog(sprintf('没有获取到房源[%d]精选计划', $houseLog['houseId']));
         return;
     }
     if ($choicePlanInfo['status'] != Model_Plan_EsfAjkPropSpread::ONLINE && $choicePlanInfo['status'] != Model_Plan_EsfAjkPropSpread::ONQUEUE) {
         $this->setLog(sprintf('房源[%d]精选计划[%d]状态[%d]不在推广、排队中', $houseLog['houseId'], $choicePlanInfo['id'], $choicePlanInfo['status']));
         return;
     }
     Model_Choice_ActionQueue::addBidQueen(array('siteType' => $houseLog['siteType'], 'brokerId' => $houseLog['brokerId'], 'planId' => $choicePlanInfo['id'], 'proId' => $houseLog['houseId'], 'actionId' => Const_ChoiceType::CHOICE_HOUSE_AREA_CHANGE, 'createTime' => time(), 'createRemark' => sprintf('房源日志id:%d;type:%d', $houseLog['id'], $houseLog['type']), 'status' => 0, 'operationId' => $houseLog['operatorId'], 'ip' => 'Choice_CheckProLogToBidQueen'));
     $this->setLog(sprintf('房源[%d - %d]价格段变更,通知精选队列', $houseLog['houseId'], $choicePlanInfo['id']));
 }
示例#6
0
 /**
  *获取房源计划信息以便判断是否竞价是否定价
  */
 public static function getAjkPropSpreadByIds($propIds)
 {
     return Model_Plan_AjkPropspread::data_access()->force_master()->load_field('bidVersion')->load_field('status')->load_field('propId')->filter('propId', $propIds)->filter_by_op('status', '<>', 2)->sort('id', 'desc')->get_all();
 }
 /**
  * 根据板块、价格段查询坑里面的精选房源
  *
  * @param $commId
  * @param $minPrice
  * @param $maxPrice
  * @return array
  */
 public static function getPropQueueSpreadByBlockBucket($areacode, $minPrice, $maxPrice)
 {
     try {
         return Model_Plan_AjkPropspread::data_access()->filter('areacode', $areacode)->filter('status', Model_Plan_EsfAjkPropSpread::ONQUEUE)->filter('bidVersion', Model_Plan_EsfAjkPropSpread::CHOICEVERSION)->filter('smallprice', $minPrice)->filter('bigprice', $maxPrice)->filter('tradetype', 1)->filter('model', self::BLOCK_CHOICE)->sort('createtime', 'asc')->get_all();
     } catch (Exception $e) {
         return array();
     }
 }
示例#8
0
 /**
  *
  */
 public function handle_request()
 {
     //分表
     $date = date('Ymd');
     //获取游标
     $dateFlag = $this->getFlag();
     if (!empty($dateFlag)) {
         $date = $dateFlag['date'];
     }
     //竞价队列数据获取
     $split = date('m', strtotime($date));
     $year = date('Y', strtotime($date));
     $day = date('d', strtotime($date));
     $BidList = Model_Choice_ActionQueue::getBidQueenList($split);
     //判断当前队列是否处理完成
     if (empty($BidList)) {
         //判断是否切换表
         if ($split + 0 != date('m') + 0) {
             $split += 1;
             if ($split < 10) {
                 $date = $year . '0' . $split . $day;
             } elseif ($split <= 12) {
                 $date = $year . $split . $day;
             } else {
                 $date = $year + 1 . '0' . ($split - 12) . $day;
             }
             //记录表游标
             $this->setFlag(array('date' => $date));
         }
         //休息1秒钟
         $this->setShCommonSleepTime(1);
         $this->setLog(date('Y-m-d H:i:s') . ' 处理完成');
         exit;
     }
     //队列数据处理
     foreach ($BidList as $list) {
         try {
             $AjkChoice = new Bll_Plan_Bid_AjkChoice();
             $AjkBlockChoice = new Bll_Plan_Bid_AjkBlockChoice();
             $result = '';
             if ($list['siteType'] == 1) {
                 //查询计划信息
                 $propSpread = Model_Plan_AjkPropspread::getAjkPropspreadById($list['planId']);
             }
             switch ($list['actionId']) {
                 case 1:
                     //精选推广
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 1;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceStartForJobByBroker($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceStartForJobByBroker($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::choiceSpread($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::choicePromotion($list);
                     }
                     break;
                 case 2:
                     //手动停止
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 3;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceStopForJobByBroker($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceStopForJobByBroker($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::stopChoiceSpread($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::stopSpread($list);
                     }
                     break;
                 case 3:
                     //计划14天到期
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 6;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceStopForJobBySystem($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceStopForJobBySystem($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::timeIsUp($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::expireSpread($list);
                     }
                     break;
                 case 4:
                     //计划没钱
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 5;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceStopForJobByNoMoney($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceStopForJobByNoMoney($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::planNoMoney($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::noMoneySpread($list);
                     }
                     break;
                 case 5:
                     //房源移出定价计划,导致精选停止(房源日志发起)
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 2;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceStopForJobBySystem($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceStopForJobBySystem($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::removeFixPlanForChoice($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::removeFixSpread($list);
                     }
                     break;
                 case 6:
                     //房源价格变更(房源日志发起)
                     $priceaArr = json_decode($list['createRemark'], true);
                     $list = array_merge($list, $priceaArr);
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 4;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceChangePriceForJob($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceChangePriceForJob($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::changeProPrice($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::changePriceForHouse($list);
                     }
                     break;
                 case 7:
                     //房源移出定价计划,导致竞价停止(房源日志发起)20140717 caoyang 新增
                     if ($list['siteType'] == 1) {
                         /** 二手房走老队列 */
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::removeFixPlanForBid($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpBidManage::stopJpBidData($list);
                     }
                     break;
                 case Const_ChoiceType::CHOICE_REMOVE_FROM_COMBO:
                     //房源取消套餐推广,导致精选停止(房源日志发起)20140815 caoyang 新增
                     if ($list['siteType'] == 1) {
                         $list['bidStatus'] = 2;
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choiceStopForJobBySystem($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->blockChoiceStopForJobBySystem($list);
                         }
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::removeComboForChoice($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpChoice::removeFixSpread($list);
                     }
                     break;
                 case Const_ChoiceType::BID_REMOVE_FROM_COMBO:
                     //房源取消套餐推广,导致竞价停止(房源日志发起)20140815 caoyang 新增
                     if ($list['siteType'] == 1) {
                         /** 二手房走老队列 */
                     } elseif ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::removeFixPlanForBid($list);
                     } elseif ($list['siteType'] == 3) {
                         $result = Bll_Plan_Bid_JpBidManage::stopJpBidData($list);
                     }
                     break;
                     /** 精选房源板块变更 */
                 /** 精选房源板块变更 */
                 case Const_ChoiceType::CHOICE_HOUSE_AREA_CHANGE:
                     if ($list['siteType'] == 1) {
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->communityMerge($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->communityMerge($list);
                         }
                         break;
                     }
                     if ($list['siteType'] == 2) {
                         $result = Bll_Plan_Bid_HzChoice::houseAreaChange($list);
                         break;
                     } else {
                         if ($list['siteType'] == 3) {
                             $result = Bll_Plan_Bid_JpChoice::houseBlockChange($list);
                         }
                     }
                     break;
                     /** 精选房源价格段变更 */
                 /** 精选房源价格段变更 */
                 case Const_ChoiceType::CHOICE_PRICE_INTERVAL_CHANGE:
                     $result = array('status' => 2, 'msg' => '未知的动作类型');
                     if ($list['siteType'] == 1) {
                         if ($propSpread['model'] == 1) {
                             $result = $AjkChoice->choicePriceIntervalChange($list);
                         } elseif ($propSpread['model'] == 2) {
                             $result = $AjkBlockChoice->choicePriceIntervalChange($list);
                         }
                     }
                     break;
                     /** 精选上下架状态维护,该上没上,改下没下 */
                 /** 精选上下架状态维护,该上没上,改下没下 */
                 case Const_ChoiceType::NOTIFY_SOLR_UP_DOWN:
                     switch ($list['siteType']) {
                         case Const_Site::ANJUKE:
                             $result = $AjkChoice->notifySolrUpDown($list);
                             break;
                         case Const_Site::HAOZU:
                             $result = Bll_Plan_Bid_HzChoice::notifySolrUpDown($list);
                             break;
                         case Const_Site::JINPU:
                             $result = Bll_Plan_Bid_JpChoice::notifySolrUpDown($list);
                             break;
                     }
                     break;
                 default:
                     $result = array('status' => 2, 'msg' => '未知的动作类型');
                     break;
             }
             //解析返回值
             if ($list['siteType'] == 1) {
                 $status = $result ? 1 : 2;
                 if ($propSpread['model'] == 1) {
                     $updateRemark = $AjkChoice->getMsg();
                 } elseif ($propSpread['model'] == 2) {
                     $updateRemark = $AjkBlockChoice->getMsg();
                 }
             } elseif ($list['siteType'] == 2) {
                 $status = $result['status'] ? 1 : 2;
                 $updateRemark = is_array($result['msg']) ? implode(';', $result['msg']) : $result['msg'];
             } elseif ($list['siteType'] == 3) {
                 $status = $result['status'] ? 1 : 2;
                 $updateRemark = is_array($result['msg']) ? implode(';', $result['msg']) : $result['msg'];
             } else {
                 $status = 2;
                 $updateRemark = '未知的网站类型';
             }
         } catch (Exception $e) {
             $status = 2;
             $updateRemark = print_r($e, true);
         }
         //更新队列状态
         Model_Choice_ActionQueue::setBidQueenStatusById($split, $list['id'], $status, $updateRemark);
         //记录处理日志
         $this->setLog(date('Y-m-d H:i:s') . ' id:' . $list['id'] . '; 网站: ' . $list['siteType'] . '; split:' . $split . '; remark:' . $updateRemark);
         //记录表游标
         $this->setFlag(array('date' => $date));
     }
     //休息10毫秒
     $this->setShCommonSleepTime(0.01);
 }
示例#9
0
 /**
  * 二手房精选该上没上,改下没下
  *
  * @param array $queue
  * @return bool
  */
 public function notifySolrUpDown($queue)
 {
     $choicePlan = Model_Plan_AjkPropspread::getAjkPropspreadByProId(intval($queue['proId']));
     /** 如果房源当前为推广中,则通知solr上架房源 */
     if (!empty($choicePlan) && $choicePlan['status'] == 1) {
         $queue['planId'] = $choicePlan['id'];
         $this->setMsg(sprintf('房源[%d]的精选计划[%d]的状态[%d]为推广中,通知solr上架', $queue['proId'], $choicePlan['id'], $choicePlan['status']));
         $queue['cityId'] = $choicePlan['cityId'];
         $param = array('city_id' => $choicePlan['cityId'], 'broker_id' => $choicePlan['brokerId'], 'pro_id' => $choicePlan['propId'], 'flag' => Bll_Combo_NoticeSolrUpDown::SOLR_ACTION_UP, 'hpratio' => $choicePlan['offer'], 'comms_hpratio_a' => $choicePlan['commsHpratioA'], 'comms_hpratio' => $choicePlan['commsHpratio'], 'hpstarttime' => $choicePlan['spreadstartdate'], 'hpendtime' => $choicePlan['spreadenddate'], 'hpplanid' => $choicePlan['id'], 'update_time' => time(), 'from_type' => Bll_Combo_NoticeSolrUpDown::HLS_FROM_CHOICE_NOTIFY_SOLR_UP_DOWN);
         $this->writePropLog($queue, Const_ProLogType::LOG_CHOICE_NOFITY_SOLR_UP, '精选该上没上,该下没下');
         return $this->choiceUpDownSendSolr($param);
     }
     if (!empty($choicePlan)) {
         $queue['planId'] = $choicePlan['id'];
         $this->setMsg(sprintf('房源[%d]的精选计划[%d]的状态[%d]为非推广中,通知solr下架', $queue['proId'], $choicePlan['id'], $choicePlan['status']));
         $queue['cityId'] = $choicePlan['cityId'];
         $param = array('city_id' => $choicePlan['cityId'], 'broker_id' => $choicePlan['brokerId'], 'pro_id' => $choicePlan['propId'], 'flag' => Bll_Combo_NoticeSolrUpDown::SOLR_ACTION_DOWN, 'hpratio' => $choicePlan['offer'], 'comms_hpratio_a' => $choicePlan['commsHpratioA'], 'comms_hpratio' => $choicePlan['commsHpratio'], 'hpstarttime' => $choicePlan['spreadstartdate'], 'hpendtime' => $choicePlan['spreadenddate'], 'hpplanid' => $choicePlan['id'], 'update_time' => time(), 'from_type' => Bll_Combo_NoticeSolrUpDown::HLS_FROM_CHOICE_NOTIFY_SOLR_UP_DOWN);
         $this->writePropLog($queue, Const_ProLogType::LOG_CHOICE_NOFITY_SOLR_DOWN, '精选该上没上,该下没下');
         return $this->choiceUpDownSendSolr($param);
     }
     $this->setMsg(sprintf('没有获取到精选计划'));
     $cityId = Model_Broker_AjkBrokerExtend::getCityIdByBrokerId($queue['brokerId']);
     $queue['cityId'] = $cityId;
     $param = array('city_id' => $cityId, 'broker_id' => $queue['brokerId'], 'pro_id' => $queue['proId'], 'flag' => Bll_Combo_NoticeSolrUpDown::SOLR_ACTION_DOWN, 'hpratio' => $choicePlan['offer'], 'comms_hpratio_a' => 0, 'comms_hpratio' => 0, 'hpstarttime' => 0, 'hpendtime' => 0, 'hpplanid' => 0, 'update_time' => time(), 'from_type' => Bll_Combo_NoticeSolrUpDown::HLS_FROM_CHOICE_NOTIFY_SOLR_UP_DOWN);
     $this->writePropLog($queue, Const_ProLogType::LOG_CHOICE_NOFITY_SOLR_DOWN, '精选该上没上,该下没下');
     return $this->choiceUpDownSendSolr($param);
 }