$addSql=" left join (select buildproperty_id,house_area,image_id,house_id as bph_id from a_district_area) ada on th.id = ada.bph_id".
" left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on ada.buildproperty_id = dbp.bp_value";
$addSql=" left join (select buildproperty_id,house_area,image_id,house_id as bph_id from ".Config::A_DISTRICT_AREA_TABLE.") ada on th.id = ada.bph_id".
" left join (select value as bp_value,literal as bp_literal from ".Config::DIC_BUILDPROPERTY_TABLE.") dbp on ada.buildproperty_id = dbp.bp_value";
$orderbySql=" group by th.id order by th.creattime DESC";
}elseif($array['houseType']==1){
$addSql=" left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value";
$addSql=" left join (select value as bp_value,literal as bp_literal from ".Config::DIC_BUILDPROPERTY_TABLE.") dbp on th.buildproperty_id = dbp.bp_value";
if($array['feature']>-1){
$addSql.=" left join (select house_id,tag_id from a_house_tag) aht on th.id = aht.house_id";
$addSql.=" left join (select house_id,tag_id from ".Config::A_HOUSE_TAG_TABLE.") aht on th.id = aht.house_id";
$addWhereSql=" and tag_id = ".$array['feature'];
}
$orderbySql=" order by th.creattime DESC";
}elseif($array['houseType']==2){
$addSql=" left join (select value as bp_value,literal as bp_literal from dic_buildproperty) dbp on th.buildproperty_id = dbp.bp_value";
$addSql=" left join (select value as bp_value,literal as bp_literal from ".Config::DIC_BUILDPROPERTY_TABLE.") dbp on th.buildproperty_id = dbp.bp_value";
$statusSql="select status_id as id from tospur_house th
left join(select status_type,status_id,status_name from tospur_status) ts on th.status = ts.status_id where th.id=".$hid." and status_type=".$statusType;
left join(select status_type,status_id,status_name from ".Config::TOSPUR_STATUS_TABLE.") ts on th.status = ts.status_id where th.id=".$hid." and status_type=".$statusType;
$status=$wpdb->get_row($statusSql);
return$status;
}
publicstaticfunctionsearchRent($hid){
global$wpdb;
$rentSql="select rent as value from tospur_house where id = %d";
$rentSql="select rent as value from ".Config::TOSPUR_HOUSE_TABLE." where id = %d";