Skip to content

Commit

Permalink
Fix: List only locations of houses listed
Browse files Browse the repository at this point in the history
Make sure that getAllLocations functions in the housedataModel only
fetch locations of listed houses only
  • Loading branch information
haastrupea committed Jul 11, 2020
1 parent 2a69096 commit ab5dc9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/housedataModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public function validate($data,$validate){
public function getAllLocations()
{
//get all Unique location from db
$sql="SELECT area_located from Houses GROUP BY area_located ORDER BY COUNT(area_located) DESC";
$sql="SELECT area_located from Houses where status ='listed' GROUP BY area_located ORDER BY COUNT(area_located) DESC";
$result=$this->dbCon->crudQuery($sql);
return $result;
}
Expand Down Expand Up @@ -466,7 +466,7 @@ public function getPreviewPhoto($house_id){
//get the real id of the house
$real_id=$this->gethouseRealId($house_id);
//get all the house pictures
$sql="SELECT view,description,ext,image FROM House_photo_gallery where house_id=:hs_id and view='front' LIMIT 1";
$sql="SELECT view,description,ext,image FROM House_photo_gallery where house_id=:hs_id LIMIT 1";
$house=$this->dbCon->crudQuery($sql,[':hs_id'=>$real_id]);
if(empty($house)){
$house=[
Expand Down

0 comments on commit ab5dc9e

Please sign in to comment.