Commit 322d3bb5 authored by clone's avatar clone

Merge branch '0529-v3.3.0' of https://gitee.com/zwyjjc/tl_estate into 0529-v3.3.0

parents 06dcbfaa 5d84dbf3
......@@ -724,7 +724,7 @@ class OfficeRoomService
$house_img_data[$k]['image_path'] = $this->internet_path.$v['img_name'];
}
}
return $house_img_data?$house_img_data:'';
return $house_img_data?$house_img_data:[];
}
//交通信息
......
......@@ -23,6 +23,7 @@ class OfficeService
private $m_office_img;
private $m_building_stations;
private $service_room;
private $internet_path;
public function __construct()
{
......@@ -31,6 +32,11 @@ class OfficeService
$this->m_office_img = new OfficeGImg();
$this->m_building_stations = new OfficeGBuildingStations();
$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
$where['img_status'] = 0;
$where['house_id'] = $id;
$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){
foreach ($house_img_data as $k=>$v) {
$house_img_data[$k]['image_path'] = $internet_path.$v['img_name'];
}
$house_img_data['image_path'] = $internet_path.$house_img_data['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
$where['house_id'] = $id;
$where['img_type'] = 2;
$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
->select();
}
public function getCoverImage($field, $where)
{
$where['img_status'] = 0;
return $this->db_->field($field)
->where($where)
->find();
}
/**
* @param $data
* @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