Update
parent
644b37da28
commit
fe42931606
|
|
@ -137,14 +137,14 @@ class DeviceLogSyncCommand extends Command
|
|||
case DeviceType::InsectSexLure:
|
||||
$data = $httpClient->getWormPhotos($device->sn, $now->copy()->subHours(24), $now);
|
||||
|
||||
foreach ($data['imgUrl'] as $item) {
|
||||
WormPhoto::firstOrCreate([
|
||||
'device_id' => $device->id,
|
||||
'uploaded_at' => $item['time'],
|
||||
], [
|
||||
'url' => $item['url'],
|
||||
]);
|
||||
}
|
||||
// foreach ($data['imgUrl'] as $item) {
|
||||
// WormPhoto::firstOrCreate([
|
||||
// 'device_id' => $device->id,
|
||||
// 'uploaded_at' => $item['time'],
|
||||
// ], [
|
||||
// 'url' => $item['url'],
|
||||
// ]);
|
||||
// }
|
||||
|
||||
$device->update([
|
||||
'status' => count($data['imgUrl'] ?? []) > 0 ? DeviceStatus::Online : DeviceStatus::Offline,
|
||||
|
|
|
|||
Loading…
Reference in New Issue