public function handle_request_internal() { if (!Bll_City::isNewCommunityApplyCity(static::$intBrokerCityID)) { $this->redirect('/ajkbroker/broker/gardener/?from=illegal_request'); } $params = $this->getParameters(); $page = isset($params['p']) ? max(1, $params['p']) : 1; $applyCount = Bll_Community_CommunityGardener::getBrokerApplyCount(static::$intBrokerID); $applyCommunityGardenerAd = Bll_Community_CommunityGardener::getCommunityGardenerHistoryApplyBannerAdInfo(static::$intBrokerCityID); if (!empty($applyCommunityGardenerAd)) { $this->setAttribute('applyCommunityGardenerAd', $applyCommunityGardenerAd[0]); } /** 如果没有申请记录则直接返回 */ if ($applyCount == 0) { $this->setAttribute('applyCount', 0); $this->setAttribute('multipageShow', false); //是否显示分页 $this->setAttribute('applyInfoList', array()); $this->setAttribute('commInfos', array()); return 'Broker_CommunityNewGardeners2'; } if ($applyCount <= self::PAGE_SIZE) { $page = 1; } /** 如果当前页面大于最大页面则直接跳转到第一页去 */ if ($page > ceil($applyCount / self::PAGE_SIZE)) { $redirectUrl = $this->getURLPrefix(); $this->redirect($redirectUrl . 'from=error_page_number'); exit; } $applyHistory = Bll_Community_CommunityGardener::getBrokerApplyHistory(static::$intBrokerID, $page, self::PAGE_SIZE); $failApplyIds = $this->initializationCommunityApplyInfo($applyHistory); // $applyFailReason = Bll_Community_CommunityGardener::getApplyFailReasonEx($failApplyIds); $communityIds = $this->getCommunityIdFromApplyInfo($applyHistory); $communityInfo = Bll_Community_CommunityGardener::getMultiCommunityInfoByCommunityId($communityIds, array('commId', 'commName')); $multiPageShow = false; if ($applyCount > self::PAGE_SIZE) { $multiPage = $this->getMultiPage(array('p' => $page), $applyCount, self::PAGE_COUNT, self::PAGE_SIZE); $multiPageShow = true; $this->setAttribute("multipage", $multiPage); } $this->setAttribute('applyCount', $applyCount); $this->setAttribute('multipageShow', $multiPageShow); $this->setAttribute('applyInfoList', $applyHistory); // $this->setAttribute('applyFailReason', $applyFailReason); $this->setAttribute('commInfo', $communityInfo); return 'Broker_CommunityNewGardeners2'; }