Пример #1
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $customerId = $this->_params['customerId'];
     // 判断经纪人是否存在
     $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$broker) {
         throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId);
     }
     // 获取客户最新信息
     $relation = Model_Mobile_BrokerUserRelation::getBrokerCustomerMonthLatestRelation($brokerId, $customerId);
     if (!$relation) {
         $relation = Model_Mobile_BrokerUserRelation::getBrokerCustomerLatestTryLockRelation($brokerId, $customerId);
         if (!$relation) {
             throw new Exception_CustomerRush_RelationNotFound("BrokerId: {$brokerId}; CustomerId: {$customerId};");
         }
     }
     switch ($relation->rentType) {
         case 1:
             $rentDesc = '整租';
             break;
         case 2:
             $rentDesc = '合租';
             break;
         default:
             $rentDesc = '';
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('preferPrice' => $relation->pricePreference, 'preferHouseType' => $relation->houseTypePreference, 'preferCommunities' => explode(',', $relation->commPreferenceDesc), 'channelType' => $relation->channelType, 'channelDesc' => $relation->channelDesc, 'rentType' => $relation->rentType, 'rentDesc' => $rentDesc));
 }