1
0
Fork 0

monitor history

develop
panliang 2023-07-28 12:14:09 +08:00
parent 4c9d067325
commit b0d9dbe3f6
2 changed files with 6 additions and 4 deletions

View File

@ -35,9 +35,11 @@ class DeviceService extends BaseService
$url = data_get($item->extends, $history ? 'rtsp_history' : 'rtsp_url'); $url = data_get($item->extends, $history ? 'rtsp_history' : 'rtsp_url');
$src = null; $src = null;
if ($base && $url) { if ($base && $url) {
// 查看历史监控 // 查看历史监控 &starttime=2023_02_02_14_00_00&endtime=2023_02_02_15_00_00
if ($history && $start && $end) { if ($history && $start && $end) {
$url .= '?start=' . date('Y-m-d', $start) . '&end=' . data('Y-m-d', $end); $start_format = Carbon::createFromTimestamp($start)->startOfDay()->format('Y_m_d_H_i_s');
$end_format = Carbon::createFromTimestamp($end)->endOfDay()->format('Y_m_d_H_i_s');
$url .= (str_contains($url, '?') ? '&' : '?') .'starttime=' . $start_format . '&endtime=' . $end_format;
} }
$src = $base . base64_encode($url); $src = $base . base64_encode($url);
} }