Exemple #1
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']);
         }
     }
 }