示例#1
0
 /**
  * 获取与某套房源对应的推荐竞价房源
  * 
  * 开通PPC竞价的城市专用
  * 
  * @param array $p_arrPropInfo 必需字段:房源ID,小区,价格,面积,房型(室)
  * @param int $p_intLimit
  */
 public function get_replaced_haopan_props($p_arrPropInfo, $p_intLimit)
 {
     apf_require_class("DAO_Property_PropSpread");
     $objPropSpread = new DAO_Property_PropSpread();
     $strCondition = "comm_id=? and status=? and bigprice>? and smallprice<? and tradetype=? order by comms_hpratio_a desc, createtime asc";
     $arrParams = array($p_arrPropInfo['COMMID'], 1, $p_arrPropInfo['PROPRICEINT'], $p_arrPropInfo['PROPRICEINT'], 1);
     $arrPropSpreads = $objPropSpread->getPropSpreadList($strCondition, $arrParams);
     $totalNum = 0;
     $arrResult = array();
     foreach ($arrPropSpreads as $SpreadItem) {
         if ($totalNum >= $p_intLimit) {
             break;
         }
         $arrPropCompareInfo = $this->compare_property_data($p_arrPropInfo, $SpreadItem['PROP_ID']);
         if (!empty($arrPropCompareInfo)) {
             $arrResult[] = $arrPropCompareInfo;
             $totalNum++;
         }
     }
     return $arrResult;
 }