Example #1
0
 private function formatdate($house, $eEntrust)
 {
     $row = array();
     if ($house['owner400'] != 0) {
         $is400 = 1;
     } else {
         $is400 = 0;
     }
     $row['is400'] = $is400;
     $row['ownerMobile'] = $house['ownerMobile'];
     //手机. 规则抢到显示
     $row['owner400'] = $house['owner400'];
     //是否绑定400。0-否;是-具体号码
     $row['owner400Host'] = APF::get_instance()->get_config("400_host");
     if ($house['fromType'] != 0) {
         $houseExt = Model_House_CommissionHouseExtend::getHouseExtByPk($house['id']);
         $chatId = $houseExt ? $houseExt->chatId : '';
     } else {
         $chatId = '';
     }
     $row['ownerChatId'] = $chatId;
     //新增微聊id。
     return $row;
 }
Example #2
0
 /**
  * 数据整理
  * @param $data
  * @param $brokerId
  * @param $showStatus
  * @param $commLocal
  * @param $rushBrokerId
  * @param $propertyId
  * @return array
  */
 private function formatdate($data, $eBrokers, $showStatus, $commLocal, $rushBrokerId, $propertyId, $imgInfos)
 {
     if (empty($data)) {
         return '';
     }
     $business = APF::get_instance()->get_config("choice_business", "multicity");
     $row = array();
     $row['entrustId'] = $data['id'];
     //委托ID
     $row['cityId'] = $data['cityId'];
     //房源所属城市
     $row['ownerId'] = $data['userId'];
     //房东ID
     $row['ownerName'] = $data['userName'];
     //房东姓名
     if ($data['owner400'] != 0) {
         $is400 = 1;
     } else {
         $is400 = 0;
     }
     $row['is400'] = $is400;
     if ($rushBrokerId) {
         $row['ownerMobile'] = $rushBrokerId ? $data['ownerMobile'] : substr_replace($data['ownerMobile'], '*****', 3, 5);
         //手机. 规则抢到显示
         $row['owner400'] = $rushBrokerId ? $data['owner400'] : ($is400 == 1 ? substr_replace($data['owner400'], '*****', 0, strlen($data['owner400'])) : 0);
         //是否绑定400。0-否;是-具体号码
     } else {
         $row['ownerMobile'] = substr_replace($data['ownerMobile'], '*****', 3, 5);
         $row['owner400'] = $is400 == 1 ? substr_replace($data['owner400'], '*****', 0, strlen($data['owner400'])) : 0;
         //是否绑定400。0-否;是-具体号码
     }
     $row['owner400Host'] = APF::get_instance()->get_config("400_host");
     if ($data['fromType'] != 0) {
         $houseExt = Model_House_CommissionHouseExtend::getHouseExtByPk($data['id']);
         $chatId = $houseExt ? $houseExt->chatId : '';
     } else {
         $chatId = '';
     }
     if ($rushBrokerId) {
         $row['ownerChatId'] = $rushBrokerId ? $chatId : '';
         //新增微聊id。
     } else {
         $row['ownerChatId'] = '';
     }
     $row['commId'] = $data['commId'];
     //对应的小区ID
     $row['commName'] = $data['commName'];
     //小区名称
     $row['commLocal'] = $commLocal;
     //小区地址
     $row['roomNum'] = $data['roomNum'];
     //房间数量
     $row['hallNum'] = $data['hallNum'];
     //客厅的数量x
     $row['toiletNum'] = $data['toiletNum'];
     //卫生间的数量
     $row['areaNum'] = $data['areaNum'];
     //房源的建筑面积;单位”平米”
     $row['areaUnit'] = '平米';
     //房源的建筑面积;单位”平米”
     $row['propPrice'] = $data['proPrice'];
     //房源价格(万元)/房源租金(元/月)
     $row['priceUnit'] = $data['commissionType'] == 1 ? '万元' : '元/月';
     //房源价格(万元)/房源租金(元/月)
     $row['entrustType'] = $data['commissionType'];
     //1-出售,2-出租
     if (!empty($imgInfos) && $data['commissionType'] == 1) {
         foreach ($imgInfos as $imginfo) {
             $img = array();
             $img['id'] = $imginfo['id'];
             $img['smallImageUrl'] = Util_Image::getInstance()->getResizeURL($imginfo['imageId'], $imginfo['hostId'], 100, 75);
             //(拼好小图)
             $img['bigImageUrl'] = Util_Image::getInstance()->getResizeURL($imginfo['imageId'], $imginfo['hostId'], 600, 600);
             //(拼好大图)
             $img['hostId'] = $imginfo['hostId'];
             $img['width'] = $imginfo['width'] ? $imginfo['width'] : 1280;
             $img['height'] = $imginfo['height'] ? $imginfo['height'] : 1500;
             $img['hash'] = $imginfo['imageId'];
             $img['type'] = 2;
             //图片类型 1:小区图 2: 室内图 3: 户型图
             $img['entry'] = 4;
             //图片来源 1:系统默认 2:相机拍摄 3:相册选取 4: 在线图库
             $img['exists'] = 1;
             //图片是否已存在
             $img['format'] = 'JPEG';
             $imgs[] = $img;
         }
         $row['imagesInfo'] = $imgs;
     } else {
         $row['imagesInfo'] = array();
     }
     if ($showStatus == 5 || $showStatus == 6) {
         $row['showStatus'] = 7;
     } else {
         $row['showStatus'] = $showStatus;
     }
     //房源状态 0-非法数据暂时没用 1-违规删除 2-已过期 3-抢完了 4-可以抢 5-抢到未发布;6-抢到已发布未推广;7-抢到已发布已推广;8-房东已删除;9-房东停止委托;
     $row['propertyId'] = $propertyId;
     $row['created'] = $data['created'];
     //创建时间
     $row['lastModifyDate'] = $data['lastModifyDate'];
     //最后更改时间
     $row['brokerIds'] = $eBrokers ? implode(',', $eBrokers) : '';
     //该套委托二手房源的所有经纪人id
     $row['isRealityPats'] = empty($imgs) ? 0 : 1;
     //实拍icon 1:显示实拍 0:不显示
     if (!empty($business)) {
         $row['isChoiceCity'] = in_array($data['cityId'], $business) ? 1 : 0;
         //1:精选城市 0:非精选城市
     } else {
         $row['isChoiceCity'] = 0;
     }
     $row['timeState'] = Bll_Common_Format::formatTime($data['created']);
     //倒计时
     $row['brokerImages'] = array();
     if ($showStatus == 3) {
         //已抢完,加入经纪人头像
         $commissionInfo = Model_House_Commission::getCommissionsOrderById(intval($data['id']));
         $brokerIds = array();
         foreach ($commissionInfo as $comm) {
             $brokerIds[] = $comm['brokerId'];
         }
         $brokerInfo = array();
         $brokers = array();
         $brokerInfo = Model_Broker_AjkBrokerExtend::findMultiBrokers($brokerIds);
         foreach ($brokerInfo as $broInfo) {
             $brokers[$broInfo['brokerId']] = $broInfo;
         }
         if (!empty($brokerIds)) {
             foreach ($brokerIds as $broId) {
                 $photo = Util_ImageUtils::get_broker_photo_url($brokers[$broId]['userPhoto'], '200x200');
                 $row['brokerImages'][] = $photo ? $photo : APF::get_instance()->get_config("broker_image_url");
             }
         } else {
             for ($i = 0; $i < 5; $i++) {
                 $row['brokerImages'][$i] = APF::get_instance()->get_config("broker_image_url");
             }
         }
     }
     return $row;
 }