コード例 #1
0
 /**
  *
  * 获取经纪人的违规房源数
  *
  * @param $brokerId
  * @param $cityId
  * @param $siteType
  * @return int
  */
 public static function getBrokerIllegalNum($brokerId, $cityId, $siteType)
 {
     $num = 0;
     switch ($siteType) {
         case 'ajk':
             $propList = Bll_House_EsfHouse::getBrokerAllPropInfoList($brokerId, $cityId);
             foreach ($propList as $prop) {
                 if ($prop['isVisible'] != 1) {
                     $num += 1;
                 }
             }
             break;
         case 'hz':
             $brokerMapping = Bll_Broker_MainBusiness::getDataByEsfId($brokerId);
             //根据经纪人查询商铺相应
             $propList = Model_House_HzPropSearch::getPropListByUserId($brokerMapping['hzBrokerid'], $cityId, array('status' => 6));
             $num = count($propList);
             break;
         case 'jp':
             $brokerMapping = Bll_Broker_MainBusiness::getDataByEsfId($brokerId);
             //根据经纪人查询商铺相应
             $baseInfo = Model_House_JpHouseIdx::data_access()->filter('memberId', $brokerMapping['jpBrokerid'])->filter('isDelete', Model_House_JpHouseIdx::ENUM_IS_DELETE_NO)->get_all();
             if (!$baseInfo) {
                 return $num;
             }
             $houseIds = array();
             foreach ($baseInfo as $hInfo) {
                 $houseIds[] = $hInfo['id'];
             }
             //获取房源的标签
             $jpOfficeRent = Model_House_JpOfficeRent::getPropInfoByIds($houseIds);
             $jpOfficeSale = Model_House_JpOfficeSale::getPropInfoByIds($houseIds);
             $jpShopRent = Model_House_JpShopRent::getPropInfoByIds($houseIds);
             $jpShopSale = Model_House_JpShopSale::getPropInfoByIds($houseIds);
             $houseList = array_merge($jpOfficeRent, $jpOfficeSale, $jpShopRent, $jpShopSale);
             $num = 0;
             foreach ($houseList as $list) {
                 if ($list['isIllegal'] == 1) {
                     $num += 1;
                 }
             }
             break;
         default:
             break;
     }
     return $num;
 }