Compare commits
2 Commits
6e8b53e50d
...
56226b84a6
| Author | SHA1 | Date |
|---|---|---|
|
|
56226b84a6 | |
|
|
72f056cf04 |
|
|
@ -76,7 +76,7 @@ class DeviceLogSyncCommand extends Command
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(new BiAngDeviceLogService())->sync($device, $now);
|
(new BiAngDeviceLogService())->sync($device, $now->copy());
|
||||||
|
|
||||||
$this->info('同步成功!');
|
$this->info('同步成功!');
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class BiAngDeviceLogService
|
||||||
if ($data['status'] === 'online') {
|
if ($data['status'] === 'online') {
|
||||||
InsecticidalLampReport::updateOrCreate([
|
InsecticidalLampReport::updateOrCreate([
|
||||||
'device_id' => $device->id,
|
'device_id' => $device->id,
|
||||||
'reported_at' => $syncTime->copy()->startOfHour(),
|
'reported_at' => $syncTime->startOfHour(),
|
||||||
], [
|
], [
|
||||||
'battery_vol' => $data['vol'],
|
'battery_vol' => $data['vol'],
|
||||||
'killed_num' => $data['dct'],
|
'killed_num' => $data['dct'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue