Commit 5d84dbf3 authored by zhuwei's avatar zhuwei

1

parent feb61f5c
...@@ -23,6 +23,7 @@ class OfficeService ...@@ -23,6 +23,7 @@ class OfficeService
private $m_office_img; private $m_office_img;
private $m_building_stations; private $m_building_stations;
private $service_room; private $service_room;
private $internet_path;
public function __construct() public function __construct()
{ {
...@@ -31,6 +32,11 @@ class OfficeService ...@@ -31,6 +32,11 @@ class OfficeService
$this->m_office_img = new OfficeGImg(); $this->m_office_img = new OfficeGImg();
$this->m_building_stations = new OfficeGBuildingStations(); $this->m_building_stations = new OfficeGBuildingStations();
$this->service_room = new OfficeRoomService(); $this->service_room = new OfficeRoomService();
if (CURRENT_URL == 'https://api.tonglianjituan.com/') {
$this->internet_path = IMAGES_URL.'/resource/lib/Attachments/images/';
}else {
$this->internet_path = 'http://pre2.tonglianjituan.com/resource/lib/Attachments/images/';
}
} }
/** /**
...@@ -392,15 +398,13 @@ class OfficeService ...@@ -392,15 +398,13 @@ class OfficeService
$where['img_status'] = 0; $where['img_status'] = 0;
$where['house_id'] = $id; $where['house_id'] = $id;
$where['img_type'] = 1; $where['img_type'] = 1;
$house_img_data = $this->m_office_img->getListAll('id,img_name', $where); $house_img_data = $this->m_office_img->getCoverImage('id,img_name', $where);
if($house_img_data){ if($house_img_data){
foreach ($house_img_data as $k=>$v) { $house_img_data['image_path'] = $internet_path.$house_img_data['img_name'];
$house_img_data[$k]['image_path'] = $internet_path.$v['img_name'];
}
} }
return $house_img_data;
// return $house_img_data[0]['img_name']; return $house_img_data?$house_img_data:[];
} }
//标签 //标签
...@@ -442,7 +446,12 @@ class OfficeService ...@@ -442,7 +446,12 @@ class OfficeService
$where['house_id'] = $id; $where['house_id'] = $id;
$where['img_type'] = 2; $where['img_type'] = 2;
$house_img_data = $this->m_office_img->getListAll('id,img_name', $where); $house_img_data = $this->m_office_img->getListAll('id,img_name', $where);
return $house_img_data; if($house_img_data){
foreach ($house_img_data as $k=>$v) {
$house_img_data[$k]['image_path'] = $this->internet_path.$v['img_name'];
}
}
return $house_img_data?$house_img_data:[];
} }
//房源数 //房源数
......
...@@ -88,6 +88,13 @@ class OfficeGImg extends BaseModel ...@@ -88,6 +88,13 @@ class OfficeGImg extends BaseModel
->select(); ->select();
} }
public function getCoverImage($field, $where)
{
$where['img_status'] = 0;
return $this->db_->field($field)
->where($where)
->find();
}
/** /**
* @param $data * @param $data
* @param $where * @param $where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment