Пример #1
0
 public static function saveHouseInfo($brokerId, $cityId, $commissionId, $params, $isComboBroker)
 {
     /** 验证小区 */
     $communityId = $params['CommId'];
     if (!Bll_House_EsfPublish::verifyCommunity($cityId, $communityId)) {
         return array('status' => 'error', 'info' => '小区不存在');
     }
     $field = Bll_House_EsfPublish::prepareApiParam($brokerId, $params);
     /**
      * @var $result Bll_Service_Client_HttpResponse
      */
     if ($isComboBroker) {
         $result = Bll_Service_House::esfAddHouseCombo($field);
     } else {
         $result = Bll_Service_House::esfAddHousePPC($field);
     }
     if ($result->isFailed()) {
         return array('status' => 'error', 'info' => '调用API超时');
     }
     if ($result['status'] != 'ok') {
         return array('status' => 'error', 'code' => $result['code'], 'info' => $result['info']);
     }
     $houseId = $result['action']['proid'];
     //todo 更新委托房源信息
     static::insertCommissionSaleLog($brokerId, $cityId, $commissionId, $houseId);
     $saveImageResult = Bll_House_EsfPublish::saveImage($houseId, $params);
     $saveImageResult['houseId'] = $houseId;
     return $saveImageResult;
 }
Пример #2
0
 /**
  * 房源发布
  *
  * @param int $brokerId
  * @param $params
  * @throws
  *
  * @return int
  */
 public static function publishHouse($brokerId, $params)
 {
     if (!is_array($params) || empty($params)) {
         throw new Exception('发布房源,房源信息不能为空');
     }
     $params['broker_id'] = $brokerId;
     if (Bll_Broker_HzBroker::isComboBroker($brokerId)) {
         $result = Bll_Service_House::esfAddHouseCombo($params);
     } elseif (Bll_Broker_HzBroker::isPpcBroker($brokerId)) {
         $result = Bll_Service_House::esfAddHousePPC($params);
     } else {
         throw new Exception('经纪人不是新套餐或PPC经纪人');
     }
     if ($result['status'] == 'ok') {
         return $result['action']['proid'];
     }
     return 0;
 }
Пример #3
0
 /**
  * 保存房源信息
  *
  * @param bool $isComboBroker
  * @param int $brokerId
  * @param array $params
  * @return array
  */
 public static function saveHouseInfo($brokerId, $params, $isComboBroker)
 {
     $field = static::prepareApiParam($brokerId, $params);
     /**
      * @var $result Bll_Service_Client_HttpResponse
      */
     if ($isComboBroker) {
         $result = Bll_Service_House::esfAddHouseCombo($field);
     } else {
         $result = Bll_Service_House::esfAddHousePPC($field);
     }
     if ($result->isFailed()) {
         return array('status' => 'error', 'info' => '调用API超时');
     }
     if ($result['status'] != 'ok') {
         return array('status' => 'error', 'code' => $result['code'], 'info' => $result['info']);
     }
     $houseId = $result['action']['proid'];
     $saveImageResult = static::saveImage($houseId, $params);
     $saveImageResult['houseId'] = $houseId;
     return $saveImageResult;
 }