public static function beforePostInjectAfter($ctx) { // 委托房源 $ctx['commission'] = null; if (isset($ctx['commission']) && (int) $ctx['commission'] > 0) { $commissionId = (int) $ctx['commission']; unset($ctx['commission']); // 获取委托房源信息 $commission = Bll_House_HzHouse::getCommissionHouse($commissionId, $ctx['ajkBrokerId']); if ($commission) { // 如果委托房源已经发布,跳转至房源详情页面 if ($commission['brokerHouseId']) { APF::get_instance()->get_response()->redirect('/ajkbroker/user/house/propview/hz/' . $commission['brokerHouseId']); } // 委托信息 $ctx['isCommission'] = 1; $ctx['commissionId'] = $commission['id']; // 默认值(如果经纪人修改过,忽略这些值) if (APF::get_instance()->get_request()->is_get_method()) { $ctx['renttype'] = $commission['house']['rentType']; $ctx['roomnum'] = $commission['house']['roomNum']; $ctx['hallnum'] = $commission['house']['hallNum']; $ctx['toilnetnum'] = $commission['house']['toiletNum']; $ctx['areanum'] = $commission['house']['areaNum']; } // 获取委托房源的小区信息 $arrMatchComm = Util_SearchUtil::getHzSearchCommunity($ctx['cityId'], $commission['house']['commName']); if ($arrMatchComm) { $arrMatchComm['commname'] = $commission['house']['commName']; $ctx['areaid'] = $arrMatchComm['areaid']; $ctx['blockid'] = $arrMatchComm['blockid']; $ctx['commid'] = $arrMatchComm['commid']; $ctx['commname'] = $commission['house']['commName']; $ctx['address'] = $arrMatchComm['address']; $ctx['block_name'] = $arrMatchComm['blockname']; $ctx['area_name'] = $arrMatchComm['areaname']; } $commission['community'] = $arrMatchComm; $ctx['commission'] = $commission; } // 委托end } // others return $ctx; }