Beispiel #1
0
 /**
  * 获取租房房源列表信息
  * @return array
  */
 private function getBrokerZfPro()
 {
     //获取经纪人参加活动租房房源id
     $proIds = $this->getProIdsByBrokerId(Bll_Combo_HouseRelation::SITE_TYPE_HZ);
     //获取经纪人参加活动租房房源详细信息
     $proInfos = Bll_House_HzPro::getInstance()->getBrokerHzProInfo($proIds, $this->cityId);
     //租房房源主表信息
     $propMainInfo = Bll_House_HzPro::getInstance()->getHzProInfoByIds($proIds);
     $propMainNew = array();
     foreach ($propMainInfo as $val) {
         $propMainNew[$val['propId']]['contentBasic'] = json_decode($val['contentBasic'], true);
         $propMainNew[$val['propId']]['contentOther'] = json_decode($val['contentOther'], true);
     }
     //获取经纪人已经参加活动房源
     $getBrokerResActivity = Bll_Activity_Res_ProInfo::getBrokerResActivityPropInfo($this->brokerId);
     $resActivityNum = count($getBrokerResActivity);
     //过滤已经参加活动租房房源,同时返回必须参数(参数拼接)
     $result = Bll_Activity_Res_ProInfo::getCanSetZfProList($proInfos, $propMainNew, $getBrokerResActivity);
     //根据最新发布时间排序
     array_multisort($result['orderByZfProId'], SORT_DESC, $result['data']);
     return $pageAttributes = array('data' => $result['data'], 'resActivityNum' => $resActivityNum, 'resActivityNumLeave' => 10 - $resActivityNum);
 }
Beispiel #2
0
 /**
  * 处理post
  * @param $esfProIds
  * @param $zfProIds
  * @param $getBrokerResActivity
  */
 private function doPost($esfProIds, $zfProIds, $getBrokerResActivity)
 {
     $insertEsfData = array();
     $insertZfData = array();
     //二手房
     if (!empty($esfProIds)) {
         $esfProIdsAll = $this->getProIdsByBrokerId(Bll_Combo_HouseRelation::SITE_TYPE_AJK);
         //过滤不属于该经济人的推广房源和已经参加活动的房源
         foreach ($esfProIds as $key => $val) {
             if (!in_array($val, $esfProIdsAll)) {
                 unset($esfProIds[$key]);
             }
             if (!empty($getBrokerResActivity[$val])) {
                 unset($esfProIds[$key]);
             }
         }
         if (!empty($esfProIds)) {
             $esfProInfos = Bll_House_EsfHouse::getHouseInfo($esfProIds, $this->cityId);
             foreach ($esfProInfos as $key => $val) {
                 $insertEsfData[] = array('proId' => $val['proId'], 'brokerId' => $this->brokerId, 'cityId' => $this->cityId, 'siteType' => Bll_Activity_Res_ProInfo::SITE_TYPE_AJK, 'proContent' => json_encode(Bll_Activity_Res_ProInfo::getEsfShowInfo($val)), 'addTime' => time());
             }
         }
     }
     //租房
     if (!empty($zfProIds)) {
         $zfProIdsAll = $this->getProIdsByBrokerId(Bll_Combo_HouseRelation::SITE_TYPE_HZ);
         foreach ($zfProIds as $key => $val) {
             if (!in_array($val, $zfProIdsAll)) {
                 unset($zfProIds[$key]);
             }
             if (!empty($getBrokerResActivity[$val])) {
                 unset($zfProIds[$key]);
             }
         }
         if (!empty($zfProIds)) {
             $zfProInfos = Bll_House_HzPro::getInstance()->getBrokerHzProInfo($zfProIds, $this->cityId);
             //房源主表信息
             $propMainInfo = Bll_House_HzPro::getInstance()->getHzProInfoByIds($zfProIds);
             $propMainNew = array();
             foreach ($propMainInfo as $val) {
                 $propMainNew[$val['propId']]['contentBasic'] = json_decode($val['contentBasic'], true);
                 $propMainNew[$val['propId']]['contentOther'] = json_decode($val['contentOther'], true);
             }
             foreach ($zfProInfos as $key => $val) {
                 $insertZfData[] = array('proId' => $val['proid'], 'brokerId' => $this->brokerId, 'cityId' => $this->cityId, 'siteType' => Bll_Activity_Res_ProInfo::SITE_TYPE_HZ, 'proContent' => json_encode(Bll_Activity_Res_ProInfo::getZfShowInfo($val, $propMainNew)), 'addTime' => time());
             }
         }
     }
     //合并
     $insertData = array_merge($insertEsfData, $insertZfData);
     foreach ($insertData as $proInfo) {
         Bll_Activity_Res_ProInfo::insertBrokerResActivityPropInfo($proInfo);
         $ProPlanChangeApiBll = Bll_ProPlanChangeApiBll::get_instance();
         $ProPlanChangeApiBll->insertProPlanChange(array('broker_id' => $this->brokerId, 'pro_id' => $proInfo['proId'], 'type' => 'ACTIVITY_RES_ADD', 'from' => __CLASS__, 'remark' => '房源季用户参加活动房源', 'site_type' => $proInfo['siteType']), 0);
     }
 }
Beispiel #3
0
 /**
  * 处理经纪人提交成交房源数据
  * @param $data
  * @return string
  */
 private function doPost($data)
 {
     $error = $this->checkData($data);
     if (!empty($error)) {
         $this->redirectResult('101', $error);
     }
     //获取经纪人已经参加活动房源
     $getBrokerResActivity = Bll_Activity_Res_ProInfo::getBrokerResActivityPropInfo($this->brokerId);
     $proInfo = $getBrokerResActivity[$data['proId']];
     //判断提交成交房源信息是否是经纪人参加活动的房源
     if (empty($proInfo)) {
         $this->redirectResult('101', '请确认提交成交房源信息');
     }
     $proContent = json_decode($proInfo['proContent'], true);
     $recordContent = array('id' => $data['proId'], 'commName' => $proContent['commName'], 'roomNum' => $data['roomNum'], 'hallNum' => $data['hallNum'], 'toiletNum' => $data['toiletNum'], 'area' => $data['area'], 'floor' => $data['floor'], 'floorAll' => $data['floorAll'], 'customerName' => $data['customerName'], 'customerMobile' => $data['customerMobile'], 'customerCard' => $data['customerCard']);
     $insertData = array('activityId' => $proInfo['id'], 'proId' => $data['proId'], 'brokerId' => $this->brokerId, 'cityId' => $this->cityId, 'siteType' => $proInfo['siteType'], 'recordContent' => json_encode($recordContent), 'addTime' => time());
     if (Bll_Activity_Res_ProInfo::getRecordsByProId($this->brokerId, $data['proId'])) {
         $this->redirectResult('101', '您已经提交成交房源信息');
     }
     if (Bll_Activity_Res_ProInfo::insertResProTransactionRecord($insertData)) {
         Bll_Activity_Res_ProInfo::updateProInfoStatus(array('siteType' => $proInfo['siteType'], 'brokerId' => $this->brokerId, 'proId' => $data['proId']), array('status' => 1));
     }
 }