Commit c99bf73f authored by zhuwei's avatar zhuwei

1

parent b4447db5
......@@ -16,6 +16,7 @@ use app\model\AAgents;
use app\model\GBusinessDistrict;
use app\model\OfficeACollectHouse;
use app\model\OfficeGBuilding;
use app\model\OfficeGBuildingStations;
use app\model\OfficeGImg;
use app\model\OfficeGLandlordPhone;
use app\model\OfficeGOperatingRecord;
......@@ -33,6 +34,8 @@ class OfficeRoomService
private $agent_room;
private $landlord_phone;
private $internet_path;
private $m_building_stations;
public function __construct()
{
......@@ -43,6 +46,8 @@ class OfficeRoomService
$this->agent = new AAgents();
$this->agent_room = new OfficeGRoomToAgent();
$this->landlord_phone = new OfficeGLandlordPhone();
$this->m_building_stations = new OfficeGBuildingStations();
if (CURRENT_URL == 'https://api.tonglianjituan.com/') {
$this->internet_path = IMAGES_URL.'/resource/lib/Attachments/images/';
......@@ -729,8 +734,10 @@ class OfficeRoomService
* @return string
*/
public function getTrafficInfo($id){
$res = '8号线地铁站出站300米';
return $res;
$field = 'b.line_name_simple,b.name,a.distance';
$res = $this->m_building_stations->getTrafficInfo($field, ['a.building_id'=>$id]);
$res_str = "{$res['line_name_simple']}{$res['name']}地铁站出站{$res['distance']}米";
return $res_str;
}
/**
......
......@@ -440,12 +440,6 @@ class OfficeService
return $house_img_data;
}
//交通信息
private function getTrafficInfo($id){
$res = '8号线地铁站出站300米';
return $res;
}
//房源数
private function getRoomNum($id){
$m_office_room = new OfficeGRoom();
......
......@@ -69,4 +69,19 @@ class OfficeGBuildingStations extends BaseModel
public function insertData($data){
return $this->db_->insertAll($data);
}
/**
* 交通信息
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
*/
public function getTrafficInfo($field, $where) {
$where['a.is_del'] = 0;
return $this->db_->alias('a')
->field($field)
->join('metro_stations b', 'a.stations_id=b.id','left')
->where($where)
->find();
}
}
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