您好,登錄后才能下訂單哦!
public function indexRecomHouse($area){ $where = array(); $where['a.isDel'] = '0'; $where['a.status'] = '2'; $where['a.auditstatus'] = '1';//已審核 $where['a.salestatus'] = '0';//在售 $where['a.isRecom'] = 'Y'; $order = "a.verifyTime desc"; $field = "a.esfId,c.shi,c.ting,c.chu,c.wei,a.price,a.buildingArea,b.fangAreaId,a.villageId,b.villageName"; $data = $this->table($this->tablePrefix."house as a")->join("left join ".$this->tablePrefix."village as b on a.villageId=b.villageId")->join("left join ".$this->tablePrefix."village_pic_hsize as c on a.hsizeId=c.picId")->where($where)->field($field)->order($order)->limit(15)->select(); if($data){ $areaDb = D("FangArea"); $housePicDb = D("HousePic"); $num=0; foreach($data as $key => $val){ $data[$key]['detailUrl'] = "http://esf.$area.qq.com/House1/detail?esfId=".$val['esfId']; $data[$key]['thumbUrl'] = $housePicDb->getThumb($val['esfId']); $data[$key]['areaName'] = $areaDb->getName($val['fangAreaId']); $data[$key]['zuhe'] = $val['shi']."室".($val['ting'] ? $val['ting']."廳" : "").($val['wei'] ? $val['wei']."衛" : ""); $a= explode('.', $val['buildingArea']); if($a[1]>0){ $data[$key]['buildingArea'] = $a[0].'.'.$a[1]; }else { $data[$key]['buildingArea'] = $a[0]; } $b= explode('.', $val['price']); if($b[1]>0){ $data[$key]['price'] = $b[0].'.'.$b[1]; }else { $data[$key]['price'] = $b[0]; } //處理3層數據結構,每組下面5條數據 if($key%5 !=0){ $arr[$num][]=$data[$key]; }else { $arr[$num+1][]=$data[$key]; $num +=1; } } } return $arr; }
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。