$result=DBManager::get_results($wpdb->prepare('select id,priceValue as value from '.Config::DIC_UNITPRICERANGE_TABLE.$where,$cityId));
$result=DBManager::get_results($wpdb->prepare('select id,priceValue as value from '.Config::DIC_UNITPRICERANGE_TABLE.$where,$cityId));
...
@@ -184,7 +184,7 @@ class SearchDao
...
@@ -184,7 +184,7 @@ class SearchDao
" left join (select value as bp_value,literal as bp_literal from ".Config::DIC_BUILDPROPERTY_TABLE.") dbp on ada.buildproperty_id = dbp.bp_value";
" 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";
$orderbySql=" group by th.id order by th.creattime DESC";
}elseif($array['houseType']==1){
}elseif($array['houseType']==1){
$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";
$addSql=" left join (select value as bp_value,literal as bp_literal from ".Config::DIC_BUILDPROPERTY_TABLE.") dbp on if(th.buildproperty_id>5,5,buildproperty_id) = dbp.bp_value";
if($array['feature']>-1){
if($array['feature']>-1){
$addSql.=" left join (select house_id,tag_id from ".Config::A_HOUSE_TAG_TABLE.") 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'];
$addWhereSql=" and tag_id = ".$array['feature'];
...
@@ -307,7 +307,7 @@ class SearchDao
...
@@ -307,7 +307,7 @@ class SearchDao
LEFT JOIN ".Config::TOSPUR_ORGANIZATION_TABLE." tor on tc.subsidiaryId = tor.Id
LEFT JOIN ".Config::TOSPUR_ORGANIZATION_TABLE." tor on tc.subsidiaryId = tor.Id
where 1=1";
where 1=1";
$params=array();
$params=array();
if($organizationId!=-1){
if($organizationId!=NULL&&$organizationId!=-1){
$params[]=$organizationId;
$params[]=$organizationId;
$sql=$sql." and subsidiaryId=%d";
$sql=$sql." and subsidiaryId=%d";
}
}
...
@@ -398,10 +398,10 @@ class SearchDao
...
@@ -398,10 +398,10 @@ class SearchDao
LEFT JOIN ".Config::DIC_ROOM_TABLE." dr on dr.value = th.room_id
LEFT JOIN ".Config::DIC_ROOM_TABLE." dr on dr.value = th.room_id
where th.id in(select recommend_id from ".Config::A_HOUSE_RECOMMEND_TABLE." where house_id = %d);";
where th.id in(select recommend_id from ".Config::A_HOUSE_RECOMMEND_TABLE." where house_id = %d);";
}else{
}else{
$recommendSql="select th.id,th.name,th.community_name,ti.path,dr.value,th.rent,th.decoration,th.covered_area,th.total_price,(SELECT GROUP_CONCAT(left(tt.name,3)) from ".Config::A_HOUSE_TAG_TABLE." aht
$recommendSql="select th.id,th.name,th.community_name,ti.path,db.literal,th.rent,th.decoration,th.covered_area,th.total_price,(SELECT GROUP_CONCAT(left(tt.name,3)) from ".Config::A_HOUSE_TAG_TABLE." aht
LEFT JOIN ".Config::TOSPUR_TAG_TABLE." tt on tt.id = aht.tag_id
LEFT JOIN ".Config::TOSPUR_TAG_TABLE." tt on tt.id = aht.tag_id
where aht.house_id = th.id) as tags from ".Config::TOSPUR_HOUSE_TABLE." th
where aht.house_id = th.id) as tags from ".Config::TOSPUR_HOUSE_TABLE." th
LEFT JOIN ".Config::DIC_ROOM_TABLE." dr on dr.id = th.room_id
LEFT JOIN ".Config::DIC_BUILDPROPERTY_TABLE." db on db.value = if(th.buildproperty_id>5,5,buildproperty_id)
LEFT JOIN ".Config::TOSPUR_IMAGE_TABLE." ti on th.frontCover_id = ti.id
LEFT JOIN ".Config::TOSPUR_IMAGE_TABLE." ti on th.frontCover_id = ti.id
where th.id in(select recommend_id from ".Config::A_HOUSE_RECOMMEND_TABLE." where house_id = %d);";
where th.id in(select recommend_id from ".Config::A_HOUSE_RECOMMEND_TABLE." where house_id = %d);";