Example #1
0
 public function getPage()
 {
     $this->setAttribute('act', $this->action);
     $this->setAttribute('isComboBroker', $this->isComboBroker);
     $this->setAttribute('isPpcBroker', $this->isPpcBroker);
     /** 上海不显示小区图库 */
     $this->setAttribute('isShowCommPic', static::$intBrokerCityID == 11 ? 0 : 1);
     $this->setAttribute('showMark', static::$intBrokerCityID == Const_MultiCity::CITY_ID_LANZHOU);
     /**
      * 初始化页面基本数据
      */
     if ($this->action == 'publish') {
         if ($this->isPpcBroker) {
             $fixPlanList = BLL_Plan_EsfPropFixedPlanRelation::getBrokerValidPlan(static::$intBrokerID);
             if (empty($fixPlanList)) {
                 $fixPlanId = Bll_Ppc_ServiceAPI::createFixPlan(static::$intBrokerID, '定价', 100000, 1, 21181);
             } else {
                 $fixPlanId = $fixPlanList[0]['id'];
             }
             $this->setAttribute('fixPlanId', $fixPlanId);
         }
         $pageParams = Bll_House_EsfPublish::preparePageParam(static::$intBrokerID, static::$intBrokerCityID, $this->request);
         $this->setAttributes($pageParams);
         return 'House_PublishAjk';
     }
     if ($this->action == 'edit') {
         try {
             $pageParams = Bll_House_EsfEdit::preparePageParam(static::$intBrokerID, static::$intBrokerCityID, $this->houseId, $this->request);
             /** 违规房源不可以编辑 */
             if (isset($pageParams['houseInfo']['isIllegal']) && $pageParams['houseInfo']['isIllegal']) {
                 $this->redirect2Result(Const_PublishCode::UNKNOWN_ERROR, 'ajk', 'edit', $this->houseId, '已违规房源不可编辑');
             }
             $this->setAttributes($pageParams);
             return 'House_EditAjk';
         } catch (Exception $e) {
             $this->redirect2Result(Const_PublishCode::API_ERROR, 'ajk', 'edit', $this->houseId, $e->getMessage());
         }
     }
     if ($this->action == 'commission') {
         try {
             $pageParams = Bll_House_EsfCommission::preparePageParam(static::$intBrokerID, static::$intBrokerCityID, $this->commissionId, $this->request);
             $this->setAttributes($pageParams);
             return 'House_CommissionAjk';
         } catch (Exception $e) {
             $this->redirect2Result($e->getCode(), 'ajk', 'commission', $this->commissionId, $e->getMessage());
         }
     }
     return 'House_PublishAjk';
 }
Example #2
0
 /**
  * @param Manage_ProplistController $controller
  * @param AJKRequest $request
  * @param AJKResponse $response
  *
  * @return array
  */
 public static function getBrokerSpreadInfo($controller, $request, $response)
 {
     $cityId = $request->getBrokerCityId();
     $brokerId = $request->getBrokerId();
     $query = trim($request->get_parameter('q'));
     $pageParams = array('query' => $query);
     if (!empty($query)) {
         $pageParams['searchByCommunity'] = !is_numeric($query);
     }
     $bidPropIds = array();
     $fixPropIds = array();
     /**
      * 速度优化阶段一
      * $brokerCheckState = Bll_Broker_BrokerCheckInfo::getCheckStateByBrokerId($brokerId);
      */
     $brokerCheckState = $controller->getBrokerCheckState();
     $isChoiceCity = Bll_City::isChoiceCity($cityId);
     /** 精选城市 */
     if ($isChoiceCity) {
         $pageParams['bidTip'] = '精选';
     }
     $pageParams['isChoiceCity'] = $isChoiceCity;
     $pageParams['isBidCity'] = false;
     $pageParams['isShowCaseCity'] = Bll_City::isShowCaseCity($cityId, Const_Site::ANJUKE);
     if ($isChoiceCity) {
         /** 获取竞价计划信息 */
         $pageParams['bidPlanList'] = static::getBrokerBidPlanList($brokerId, $cityId, $bidPropIds, $isChoiceCity);
         $pageParams['bidPropIds'] = $bidPropIds;
         $pageParams['bidClickCount'] = Bll_Plan_Bid_AjkPlan::getBrokerBidClick($brokerId, date('Ymd'), $cityId);
         $pageParams['bidCost'] = Bll_Plan_Bid_AjkPlan::getBrokerBidCost($brokerId, date('Ymd'), $cityId);
     }
     /** 获取定价计划信息 */
     $pageParams['fixPlanPropList'] = static::getBrokerFixPlanList($brokerId, $cityId, $fixPropIds, $brokerCheckState);
     $pageParams['fixPropIds'] = $fixPropIds;
     if (!empty($pageParams['fixPlanPropList'])) {
         $pageParams['effectURL'] = Bll_Plan_Fix_AjkPlan::GetPlanFixedPriceDetailUri($pageParams['fixPlanPropList'][0]['planInfo']['id'], 0, 1);
     }
     $houseInfoList = static::getBrokerAllPropInfoList($brokerId, $cityId, $fixPropIds, $bidPropIds, $pageParams['isChoiceCity'], $query);
     /** 房源数量 > 0 没有计划就创建计划 创建失败的话应该是API 错误 */
     if (!empty($houseInfoList) && empty($pageParams['fixPlanPropList'])) {
         Bll_Ppc_ServiceAPI::createFixPlan($brokerId, '定价', 100000, 1, 21181);
     }
     $ppcLimitInfo = Bll_Ppc_ServiceAPI::getPpcBrokerLimitInfo($brokerId);
     if (empty($ppcLimitInfo)) {
         echo '<script type="text/javascript"> alert("服务器繁忙,请重试!"); </script>';
         exit;
     }
     $pageParams['ppcLimitInfo'] = $ppcLimitInfo;
     /** 房源质量信息 */
     $pageParams['houseSolly'] = static::getHouseSollyResult($houseInfoList['houseIdList']);
     $pageParams['selectLimitTempAvailable'] = static::checkSelectLimitTempAvailable($cityId);
     $pageParams['fixPropIds'] = array_values(array_intersect($fixPropIds, array_keys($houseInfoList['fixSpreadHouseList'])));
     //$pageParams['bidPropIds'] = array_values(array_intersect($bidPropIds, $pageParams['fixPropIds']));
     if ($isChoiceCity) {
         $houseBidInfoList = array();
         $houseBidStatus = array();
         foreach ($pageParams['bidPlanList'] as $bidInfo) {
             $houseBidInfoList[$bidInfo['propId']] = $bidInfo;
             $houseBidStatus[$bidInfo['propId']] = $bidInfo['status'];
         }
         $pageParams['houseBidStatus'] = $houseBidStatus;
         $houseInfoList['fixSpreadHouseList'] = static::extendChoiceInfo($houseInfoList['fixSpreadHouseList'], $houseBidInfoList, $cityId);
     }
     /** 精选引导优化 */
     $choiceFunctionOptimizationGuide = false;
     /*
     if ($isChoiceCity && count($houseInfoList['fixSpreadHouseList']) > 0) {
         if (Bll_Broker_AjkBrokerGuideNew::getGuideStatus($brokerId, 'Choice_Function_Optimization') == 0) {
             $choiceFunctionOptimizationGuide = true;
         }
     }
     */
     $pageParams['choiceFunctionOptimizationGuide'] = $choiceFunctionOptimizationGuide;
     return array_merge($pageParams, $houseInfoList);
 }