轨迹画线php,夏末浅笑"/>
百度地图坐标点轨迹画线php,夏末浅笑
后端php返回json数据
public function check_ajax(){
if(request()->isAjax()){
$phone_str = $this->request->post('phone_str');
$start_time = $this->request->post('start_time');
$end_time = $this->request->post('end_time');
$phone = substr($phone_str,7);
$data0 = Db::name('ship') -> where(['phone' => $phone]) ->select();
foreach ($data0 as $key => $value){
$id = $value['id'];
}
//条件查询
$map['cmf_ship.id'] = ['=',"$id"];
$map['cmf_locus.time'] = array('between',array("$start_time","$end_time"));
$map['cmf_locus.position'] = ['=',"定位"];
$map['cmf_locus.alarm'] = ['=',"一切正常"];
$data = Db::name('locus')
->alias('a')
->join('cmf_ship b','a.ship_id = b.id','left')
->field('a.id,a.time,a.ship_id,a.latitude,a.longitude,a.speed,a.height,a.direction,b.id,b.phone,b.captain,b.name')
->where($map)
->order('time' )
->select();
return $data ;
}
}
前端html代码
百度content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
更多推荐
百度地图坐标点轨迹画线php,夏末浅笑
发布评论