info(); return $result['code'] == 1 ? $this->success($result['msg'],$result['data']) : $this->fail($result['msg']); } public function getCarStatus() { $result = (new GpsLogic()) -> status(); return $result['code'] == 1 ? $this->success($result['msg'],$result['data']) : $this->fail($result['msg']); } public function getCarHistory() { //获取参数 $params = $this->request->get(['car_id','start_time','end_time']); //验证参数 if(empty($params['car_id']) || empty($params['start_time']) || empty($params['end_time'])){ return $this->fail('参数错误'); } //获取车辆行驶历史信息 $result = (new GpsLogic()) -> history($params); if($result['code'] == 1){ $data = []; foreach ($result['data'] as $k => $v) { $data[$k]['lat'] = $v['latc']; $data[$k]['lon'] = $v['lonc']; } return $this->success($result['msg'],$data); }else{ return $this->fail($result['msg']); } } public function test() { $message = [ 'title' => '测试消息', 'msg_content' => '这是一条新的推送消息' ]; $res = push_message('18071adc021402b58fb','这是条测试信息'); dump($res); return !($res['code'] == 0); } }