Commit a4316134 authored by hujun's avatar hujun

经纬度

parent 29404fc1
......@@ -71,17 +71,12 @@ class OfficeService
//新增周边交通
if (!empty($data['add_building_stations'])) {
$position_service = new PositionService();
//全部地铁站
$building_station_id = $this->m_building_stations->getFindDataColumn('stations_id', ['building_id'=>$id]);
$first_position = $data['latitude'].','.$data['longitude'];
$add_building_stations = json_decode($data['add_building_stations'], true);
foreach ($add_building_stations as $k=>$v) {
if (empty($v['stations_id'])) {
continue;
}
$where['building_id'] = $id;
$where['stations_id'] = $v['stations_id'];
$building_station_id = $this->m_building_stations->getFindData('id', $where);
if (isset($building_station_id['id'])) {
if (empty($v['stations_id']) || in_array($v['stations_id'], $building_station_id)) {
continue;
}
$save_stations[$k]['building_id'] = $id;
......
......@@ -32,6 +32,17 @@ class OfficeGBuildingStations extends BaseModel
->find();
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
*/
public function getFindDataColumn($field, $where) {
$where['is_del'] = 0;
return $this->db_->where($where)
->column($field);
}
/**
* @param $field
* @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