Пример #1
0
 /**
  * init env
  * @param AJKRequest $request
  * @param array $out
  * @throws Exception
  */
 private static function initEnv($request, &$out)
 {
     $out['debug'] = isset($_GET['debug']) ? true : false;
     $out['cityId'] = $request->getBrokerCityId();
     $out['ajkBrokerId'] = $request->getBrokerId();
     $route_matches = $request->get_router_matches();
     $out['proId'] = trim($route_matches[2], "/ \t\n\r\v");
     if (!$out['proId']) {
         throw new Exception('缺少房源Id参数');
     }
     // 获取好租brokerId
     $out['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($out['ajkBrokerId']);
     // 是否精选
     $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::HAOZU);
     $out['isBidCity'] = false;
     // 获取经纪人信息
     if (!($out['brokerInfo'] = Model_Broker_HzUsersSearch::getUserInfoByUserId($out['hzBrokerId']))) {
         throw new Exception('获取好租经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']');
     }
     // 身份是否通过
     $out['isPassVerify'] = Bll_Broker_HzBroker::isPassVerify($out['brokerInfo']['profileVerify']);
     // 获取套餐相关
     //$out['brokerLimitInfo'] = Bll_Broker_BrokerLimit::getPpcBrokerLimitInfo($out['ajkBrokerId'], Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE);
     // 获取经纪人主推房源
     $out['mainSpreadProIds'] = array();
     $mainSpreads = Model_Broker_AdPropsShowRent::getInstance()->getBrokerAdPropInfo($out['ajkBrokerId']);
     if ($mainSpreads) {
         foreach ($mainSpreads as $v) {
             $out['mainSpreadProIds'][$v->propId] = $v->propId;
         }
     }
 }
Пример #2
0
 /**
  * init env
  * @param $request
  * @param $out
  * @throws Exception
  */
 private static function initEnv($request, &$out)
 {
     $out['debug'] = isset($_GET['debug']) ? true : false;
     $out['cityId'] = $request->getBrokerCityId();
     $out['ajkBrokerId'] = $request->getBrokerId();
     // 获取好租brokerId
     $out['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($out['ajkBrokerId']);
     // 获取账户余额
     $balance = Bll_Broker_HzBroker::getAccountInfo($out['ajkBrokerId'], 'balance');
     if (!$balance['status']) {
         throw new Exception_BllErrorException($balance['msg']);
     }
     $out['validMoney'] = $balance['msg'] ? round($balance['msg'] / 100, 2) : 0;
     // 是否精选
     $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::HAOZU);
     $out['isBidCity'] = false;
     $out['isShowCaseCity'] = Bll_City::isShowCaseCity($out['cityId'], Const_Site::HAOZU);
     // 获取经纪人信息
     if (!($out['brokerInfo'] = Model_Broker_HzUsersSearch::getUserInfoByUserId($out['hzBrokerId']))) {
         throw new Exception('获取好租经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']');
     }
     // 身份是否通过
     $out['isPassVerify'] = Bll_Broker_HzBroker::isPassVerify($out['brokerInfo']['profileVerify']);
     // 获取套餐相关
     $out['brokerLimitInfo'] = Bll_Broker_BrokerLimit::getPpcBrokerLimitInfo($out['ajkBrokerId'], Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE);
     // 获取经纪人主推房源
     $out['mainSpreadProIds'] = array();
     $mainSpreads = Model_Broker_AdPropsShowRent::getInstance()->getBrokerAdPropInfo($out['ajkBrokerId']);
     if ($mainSpreads) {
         foreach ($mainSpreads as $v) {
             $out['mainSpreadProIds'][$v->propId] = $v->propId;
         }
     }
 }
Пример #3
0
 /**
  * @param AJKRequest $request
  * @param array $out
  * @throws Exception
  */
 public static function initEnv($request, &$out)
 {
     $out['debug'] = isset($_GET['debug']) ? true : false;
     $out['cityId'] = $request->getBrokerCityId();
     $out['ajkBrokerId'] = $request->getBrokerId();
     // 获取好租brokerId
     $out['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($out['ajkBrokerId']);
     // 获取账户余额
     /*$balance = Bll_Broker_HzBroker::getAccountInfo($out['ajkBrokerId'], 'balance');
       if (!$balance['status'])
           throw new Exception_BllErrorException($balance['msg']);
       $out['validMoney'] = $balance['msg'] ? round($balance['msg'] / 100, 2) : 0;
       */
     // 是否精选
     $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::HAOZU);
     $out['isBidCity'] = false;
     $out['isShowCaseCity'] = Bll_City::isShowCaseCity($out['cityId'], Const_Site::HAOZU);
     $out['bidTip'] = '精选';
     // 获取经纪人信息
     if (!($out['brokerInfo'] = Model_Broker_HzUsersSearch::getUserInfoByUserId($out['hzBrokerId']))) {
         throw new Exception('获取好租经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']');
     }
     // 身份是否通过
     $out['isPassVerify'] = Bll_Broker_HzBroker::isPassVerify($out['brokerInfo']['profileVerify']);
     // 获取该经纪人房源
     $out['props'] = Bll_House_HzHouse::getValidPropsByBrokerIdEx($out['ajkBrokerId'], $out['cityId']);
     // 获取改经纪人所有房源质量
     //$out['propsQuality'] = Model_Stats_HzPropQuality::getPropsquality(array_keys($out['props']));
     $out['propsQuality'] = static::getHzPropsQuality($out['props']);
     if (count($out['props']) > 0) {
         foreach ($out['props'] as $proId => $prop) {
             $out['props'][$proId]['proId'] = $proId;
             // 获取剩余时间
             $out['props'][$proId]['leftDays'] = Bll_House_HzHouse::getLeftDays($prop['created']);
             // 是否手机房源
             $out['props'][$proId]['isMobileProp'] = Bll_House_HzHouse::isMobileProp($prop['from'] ? $prop['from'] : '');
         }
     }
     // 获取经纪人主推房源
     $out['mainSpreadProIds'] = array();
     $mainSpreads = Model_Broker_AdPropsShowRent::getInstance()->getBrokerAdPropInfo($out['ajkBrokerId']);
     if ($mainSpreads) {
         foreach ($mainSpreads as $v) {
             $out['mainSpreadProIds'][$v->propId] = $v->propId;
         }
     }
 }
Пример #4
0
 public function afterPost()
 {
     // 推广
     if ($this->ctx['html_action'] == 'publish') {
         //伪登陆不能推广
         if ($this->ctx['isManagerCookie']) {
             $this->redirect2Result(Const_PublishCode::PSEUDO_ERROR, $this->site, $this->action, $this->ctx['proId']);
         }
         if (Bll_City::isComboCity($this->ctx['cityId'])) {
             // 套餐推广
             $spreadResult = Bll_Combo_HouseRelation::houseStartComboSpreadV2($this->ctx['ajkBrokerId'], $this->ctx['cityId'], $this->ctx['proId'], Bll_Combo_HouseRelation::SITE_TYPE_HZ);
         } else {
             // 双证审核未通过 不能推广
             // 获取经纪人信息
             $brokerInfo = Model_Broker_HzUsersSearch::getUserInfoByUserId($this->ctx['hzBrokerId']);
             // 身份是否通过
             $this->ctx['isPassVerify'] = $brokerInfo && Bll_Broker_HzBroker::isPassVerify($brokerInfo['profileVerify']);
             //if (!$isPassVerify)
             //    $this->redirect2Result(Const_PublishCode::NOT_PASS_VERIFY, $this->site, $this->action, $this->ctx['proId']);
             // 获取账户余额
             $balance = Bll_Broker_HzBroker::getAccountInfo($this->ctx['ajkBrokerId'], 'balance');
             $this->ctx['validMoney'] = $balance && $balance['msg'] ? round($balance['msg'] / 100, 2) : 0;
             //if (!$validMoney)
             //   $this->redirect2Result(Const_PublishCode::NOT_MONEY, $this->site, $this->action, $this->ctx['proId']);
             // ppc推广
             $spreadResult = Bll_Plan_Fix_HzFix::addPropToPlan($this->ctx['planId'], $this->ctx['proId'], $this->ctx['cityId'], $this->ctx['ajkBrokerId']);
         }
         // 推广出错
         if ($spreadResult['status'] <= 0) {
             $this->redirect2Result(Const_PublishCode::SPREAD_PROP_HANDLE_STOP, $this->site, $this->action, $this->ctx['proId'], $spreadResult['msg']);
         }
     }
     //++++++ others actions
     // 委托
     if (isset($this->ctx['isCommission']) && $this->ctx['isCommission']) {
         // 房源发布成功,回写委托信息
         if ($this->ctx['commission'] && $this->ctx['proId']) {
             Bll_House_HzHouse::updateCommission($this->ctx['commissionId'], $this->ctx['proId']);
         }
     }
 }