diff --git a/app/Services/LinkosDeviceLogService.php b/app/Services/LinkosDeviceLogService.php index f0459b0..7e8a51a 100644 --- a/app/Services/LinkosDeviceLogService.php +++ b/app/Services/LinkosDeviceLogService.php @@ -196,7 +196,7 @@ class LinkosDeviceLogService ]); foreach ($data as $key => $item) { - $dailyLog->{$key} = round(bcmul($item['sum'], $item['count'], 2), 2); + $dailyLog->{$key} = round(bcdiv($item['sum'], $item['count'], 2), 2); } $dailyLog->save(); @@ -329,7 +329,7 @@ class LinkosDeviceLogService break; default: - $dailyLog->{$key} = round(bcmul($item['sum'], $item['count'], 2), 2); + $dailyLog->{$key} = round(bcdiv($item['sum'], $item['count'], 2), 2); break; } } @@ -412,7 +412,7 @@ class LinkosDeviceLogService ]); foreach ($data as $key => $item) { - $dailyLog->{$key} = round(bcmul($item['sum'], $item['count'], 2), 2); + $dailyLog->{$key} = round(bcdiv($item['sum'], $item['count'], 2), 2); } $dailyLog->save();