/** * 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; } } }
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']); } } }