1
0
Fork 0
develop
李静 2023-05-08 13:39:04 +08:00
parent c4ea661dcc
commit d589404415
1 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ class DeviceLogReportCommand extends Command
$lastReportedAt = $lastMonitoringReport?->reported_at;
$device->logs()
->when($lastReportedAt, fn ($query, $lastReportedAt) => $query->where('reported_at', '>=', $lastReportedAt->reported_at))
->when($lastReportedAt, fn ($query, $lastReportedAt) => $query->where('reported_at', '>=', $lastReportedAt))
->oldest('reported_at')
->chunkById(500, function ($deviceLogs) use ($device, &$lastMonitoringReport) {
/** @var \App\Models\DeviceLog */
@ -109,7 +109,7 @@ class DeviceLogReportCommand extends Command
$lastReportedAt = $lastMonitoringReport?->reported_at;
$device->logs()
->when($lastReportedAt, fn ($query, $lastReportedAt) => $query->where('reported_at', '>=', $lastReportedAt->reported_at))
->when($lastReportedAt, fn ($query, $lastReportedAt) => $query->where('reported_at', '>=', $lastReportedAt))
->oldest('reported_at')
->chunkById(500, function ($deviceLogs) use ($device, &$lastMonitoringReport) {
/** @var \App\Models\DeviceLog */
@ -150,7 +150,7 @@ class DeviceLogReportCommand extends Command
$lastReportedAt = $lastMonitoringReport?->reported_at;
$device->logs()
->when($lastReportedAt, fn ($query, $lastReportedAt) => $query->where('reported_at', '>=', $lastReportedAt->reported_at))
->when($lastReportedAt, fn ($query, $lastReportedAt) => $query->where('reported_at', '>=', $lastReportedAt))
->oldest('reported_at')
->chunkById(500, function ($deviceLogs) use ($device, &$lastMonitoringReport) {
/** @var \App\Models\DeviceLog */