public function handle_request_internal() { $propIds = explode(',', $this->_params['propIds']); $cityId = $this->_params['cityId']; //获取房源信息 $propsInfos = Bll_House_EsfHouse::getHouseBaseInfo($propIds, $cityId); //板块信息 $blockCode = array(); $brokerIds = array(); foreach ($propsInfos as $propsInfoVal) { $blockCode[] = substr($propsInfoVal['areaCode'], 8, 4); $brokerIds[] = $propsInfoVal['brokerId']; } $blockInfos = Bll_Community_CommunityGardener::getAreaBlock($blockCode); //获取经纪人微聊信息 $chatInfos = Model_Mobile_BrokerChatInfo::getBrokerChatInfos($brokerIds); $propList = array(); foreach ($propsInfos as $propsInfo) { $row = array(); $row['brokerId'] = $propsInfo['brokerId']; $row['chatId'] = $chatInfos[$row['brokerId']]['chatId']; $row['propId'] = $propsInfo['proId']; $row['cityId'] = $propsInfo['cityId']; $row['title'] = $propsInfo['proName']; $row['commId'] = $propsInfo['commId']; $row['commName'] = $propsInfo['commName']; $row['areaCode'] = $propsInfo['areaCode']; $row['blockName'] = $blockInfos[$row['areaCode']]; $row['createTime'] = date("Y-m-d H:i:s", $propsInfo['postDate']); $row['room'] = $propsInfo['roomNum']; $row['hall'] = $propsInfo['hallNum']; $row['toilet'] = $propsInfo['toiletNum']; $row['area'] = $propsInfo['areaNum']; $row['areaUnit'] = '平米'; $row['price'] = intval($propsInfo['proPrice']); $row['priceUnit'] = '万'; //获取房源图片 $houseImageInfo = Bll_Ppc_ServiceAPI::getHouseImageInfo($propsInfo['proId']); $houseImageBaseInfos = $houseImageInfo['imageBaseInfo']; $houseImageUrls = array(); if ($houseImageBaseInfos) { foreach ($houseImageBaseInfos as $imageInfo) { $houseImageUrls[] = Util_Image::getInstance()->getResizeURL($imageInfo['FILENAME'], $imageInfo['HOST_ID'], 420, 315); } } $row['imageUrls'] = $houseImageUrls; $propList[] = $row; } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('props' => $propList)); }
public function GetChatInfoByIds($brokerIds) { $brokerList = array(); $chatInfos = Model_Mobile_BrokerChatInfo::getBrokerChatInfos($brokerIds); foreach ($chatInfos as $chatInfo) { $tmp = array(); $chatId = $chatInfo['chatId']; $response = $this->apiGetChatInfoByChatId($chatId); $twoCodeIcon = $response['data']['result']['two_code_icon']; if (!$response || $response['data']['status'] == 'ERROR' || $twoCodeIcon == '') { continue; } $tmp['chatId'] = $chatInfo['chatId']; $tmp['brokerId'] = $chatInfo['brokerId']; $tmp['twoCodeIcon'] = $twoCodeIcon; $brokerList[] = $tmp; } return $brokerList; }
/** * 推送锁屏文案 * @param $brokerId * @param string $message * @return bool */ public function push($brokerId, $message = '') { $temp = APF::get_instance()->get_config('chat_api_host'); $brokerChatInfo = Model_Mobile_BrokerChatInfo::getBrokerChatInfos($brokerId); if (empty($brokerChatInfo)) { return false; } $brokerChatInfo = $brokerChatInfo[$brokerId]; $messageUrl = $temp['host'] . '/common/sendUserNotify/' . $brokerChatInfo['chatId'] . '?from_idc=1&from=mobile-ajk-broker'; $message = json_encode(array('message' => $message, 'msgType' => 'push', 'type' => 'choiceStatuaChange', 'body' => array('type' => 'choiceStatuaChange', 'msg' => $message))); $result = Util_API::postData($messageUrl, $message); if ($result['status'] == 'OK') { $message = date('Y-m-d H:i:s') . " - brokerId: {$brokerChatInfo['brokerId']}, push_result: " . var_export($result, true); $this->setLog($message, 'Mobile_ChoiceStatusChangePush_Push'); } }