Exemple #1
0
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     if (($data = $bll->getBrokerChoiceSummary($brokerId)) === false) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
     demon:
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 1, 'todayConsume' => 12, 'todayConsumeUnit' => '元', 'minChoicePrice' => 20, 'minChoicePriceUnit' => '元', 'maxChoicePrice' => 100, 'maxChoicePriceUnit' => '元', 'totalProps' => 3));
 }
Exemple #2
0
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $houseIds = explode(',', $this->_params['propIds']);
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     if (($data = $bll->deletePlan($brokerId, $houseIds)) === false) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('msg' => '删除成功'));
     demon:
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array());
 }
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $houseId = $this->_params['propId'];
     $budget = $this->_params['budget'];
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     if (($data = $bll->startChoice($brokerId, $houseId, $budget)) === false) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
     demon:
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => bll_choice_EsfAPPAPIChoice::START_CHOICE_TO_ONLINE, 'statusMsg' => bll_choice_EsfAPPAPIChoice::START_CHOICE_TO_ONLINE_MSG));
 }
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $houseId = $this->_params['propId'];
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     $choiceStatus = $bll->getChoiceTypeByPropIds($houseId);
     if ($choiceStatus[$houseId] == 2) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => '', 'message' => '结束板块精选请在电脑端操作');
     }
     if (($data = $bll->stopPlan($brokerId, $houseId)) === false) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('msg' => '精选结束成功'));
     demon:
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array());
 }
Exemple #5
0
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     if (($data = $bll->getBrokerPropChoiceInfo($brokerId)) === false) {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
     demon:
     $data['id'] = 1;
     $data['propId'] = 1;
     $data['title'] = '房源标题';
     $data['commId'] = '10';
     $data['commName'] = '访华小区';
     $data['roomNum'] = 2;
     //室
     $data['hallNum'] = 2;
     //厅
     $data['toiletNum'] = 2;
     //卫
     $data['area'] = 100;
     //面积
     $data['price'] = 120;
     //价格
     $data['priceUnit'] = '元';
     //价格单位
     $data['isMoreImg'] = 1;
     //1-多图 0-非多图
     $data['isPhonePub'] = 1;
     //1-手机房源 0-非手机房源
     $data['isVisible'] = 1;
     //0-违规房源 1-非违规房源
     $data['isChoice'] = 1;
     //0-违规房源 1-非违规房源
     $data['imgUrl'] = 'http://pic1.ajkimg.com/display/fd36c5144dc2e7ef1f44d26ea6866be7/133x100c.jpg';
     $data['totalClicks'] = 3;
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('OnlinePropertyList' => array($data, $data), 'QueuedPropertyList' => array($data, $data), 'OfflinePropertyList' => array($data, $data)));
 }
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $houseId = $this->_params['propId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     $cityId = $brokerInfo->cityId;
     //好丑陋。。。。。。好无奈。。。。。。
     //委托房源自动转发停用,为了app能够展示报错信息。。。
     if (empty($houseId)) {
         $this->_params['apiDebug'] = 1;
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => '0000', 'message' => '委托房源自动转发功能已停用;若要发布请手动发布');
     }
     //是否显示精选概况 0 不显示; 1 正常显示
     $isDisplaySummary = 0;
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     if (($data = $bll->getPropChoiceSummary($brokerId, $houseId)) === false) {
         if ($bll->errorCode == bll_choice_EsfAPPAPIChoice::CHOICE_CLOSE_ERROR) {
             $data = array('totalClicks' => 0, 'balance' => 0, 'balanceUnit' => '元', 'todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'clickPrice' => 0, 'clickPriceUnit' => '元', 'maxBucketNum' => 0, 'usedBucketNum' => 0, 'bucketId' => '', 'status' => bll_choice_EsfAPPAPIChoice::PROP_ACTIONTYPE_CHOICE_NOTFIT, 'statusMsg' => '你所在城市未开通精选业务', 'remindStatus' => -1, 'remindStatusMsg' => '不符合精选订阅条件', 'minChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MIN_BUDGET, 'minChoicePriceUnit' => '元', 'maxChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MAX_BUDGET, 'maxChoicePriceUnit' => '元', 'isDisplaySummary' => $isDisplaySummary);
         } else {
             return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
         }
     }
     // 是否显示精选概况, 未开通精选城市 0; 分离城市||(未分离城市&&已套餐推广)1; 未分离城市&&未套餐推广 2;
     $cityIsChoice = Model_City_BizType::getCitySiteBizType($cityId, 1, 'choice');
     if (!$cityIsChoice['status']) {
         $isDisplaySummary = 0;
         //未开通精选城市
     } else {
         $isDisplaySummary = 1;
     }
     $data['isDisplaySummary'] = $isDisplaySummary;
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
     demon:
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('totalClicks' => 10, 'balance' => 10, 'balanceUnit' => '元', 'todayClicks' => 1, 'todayConsume' => 12, 'todayConsumeUnit' => '元', 'clickPrice' => 1.3, 'clickPriceUnit' => '元', 'maxBucketNum' => 12, 'usedBucketNum' => 6, 'status' => 1 - 2, 'statusMsg' => '排在第3位,马上就能推广啦!', 'minChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MIN_BUDGET, 'minChoicePriceUnit' => '元', 'maxChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MAX_BUDGET, 'maxChoicePriceUnit' => '元', 'isDisplaySummary' => 1));
 }
 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));
 }