Example #1
0
 public function basicCheck()
 {
     if (!$this->isBrokerLogin()) {
         APF::get_instance()->get_response()->redirect(Uri_MemberUrl::build_login_url($this->currentUrl));
         return false;
     }
     $this->request = APF::get_instance()->get_request();
     $brokerId = $this->request->getBrokerId();
     $cityId = $this->request->getBrokerCityId();
     $this->isComboBroker = Bll_Broker_HzBroker::isComboBroker($brokerId);
     $this->isPpcBroker = Bll_Broker_HzBroker::isPpcBroker($brokerId);
     $routeMatches = $this->request->get_router_matches();
     if (isset($routeMatches[3]) && is_numeric($routeMatches[3])) {
         $this->houseId = $routeMatches[3];
         $this->action = 'edit';
     }
     /** 委托房源发布 */
     $act = $this->request->get_parameter('act');
     $id = $this->request->get_parameter('cid');
     // commission  id
     if ($act == 'commission' && is_numeric($id)) {
         $this->commissionId = $id;
         $this->action = 'commission';
     }
     /** 验证发房数 */
     try {
         $brokerCanPublishHouse = Bll_Broker_HzBroker::checkEsfBrokerCanPublishHouse($cityId, $brokerId);
         if ($this->action != 'edit' && !$brokerCanPublishHouse) {
             $this->redirect2Result(Const_PublishCode::PUBLISH_OUT_OF_LIMIT, 'ajk', $this->action, 0, '发房数超出限制');
         }
     } catch (Exception $e) {
         $this->redirect2Result(Const_PublishCode::API_ERROR, 'ajk', $this->action, 0, $e->getMessage());
     }
     /** 验证房源 */
     if ($this->action == 'edit' && !Bll_House_EsfHouse::checkHouseExist($cityId, $this->houseId, $brokerId)) {
         $this->redirect2Result(Const_PublishCode::HOUSE_NOT_EXIST, 'ajk', $this->action, $this->houseId, '房源不存在');
     }
     return true;
 }