Browse Source

回放接口修改

任敬轩 3 years ago
parent
commit
9174773fc2

+ 6 - 1
Modules/Camera/Http/Controllers/Api/CameraApiController.php

@@ -255,8 +255,13 @@ class CameraApiController extends BaseController
             return $result;
         }
 
-        $start_time = date('c', strtotime($start_time));
+        $str = '.000+';
+        $start_time = date('c', strtotime($start_time));//2022-07-14T08:00:00.000+08:00
+        $start_time = explode('+',$start_time);
+        $start_time = $start_time[0].$str.$start_time[1];
         $end_time = date('c', strtotime($end_time));
+        $end_time = explode('+',$end_time);
+        $end_time = $end_time[0].$str.$end_time[1];
 
         $haikang = new HaiKangController();
         $result = CameraServices::getPlaybackUrl($camera_id,$start_time,$end_time);

+ 3 - 3
Modules/Camera/Http/Controllers/Api/HaiKangController.php

@@ -363,11 +363,11 @@ class HaiKangController extends BaseController
 
         $this->sign = $this->get_sign($url);
 
-        $rtsp = $this->curlPost($this->pre_url . $url, json_encode($params));
+        $data = $this->curlPost($this->pre_url . $url, json_encode($params));
 
-        $rtsp = json_decode($rtsp, true);
+        $data = json_decode($data, true);
 
-        dd($rtsp);
+        return $data;
     }
 
     public function getHikRtsp(){