diff --git a/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php b/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php index fe48db9f6..b64460931 100644 --- a/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php +++ b/zmsdb/src/Zmsdb/Helper/ArchivedDataIntoStatisticByCron.php @@ -88,8 +88,12 @@ protected function writeProcessInStatisticTable( $commit = false ) { $requestList = (new \BO\Zmsdb\Request())->readRequestByArchiveId($process->archiveId); - $requestList = ($requestList->count()) ? $requestList : [new \BO\Zmsentities\Request(['id' => '-1'])]; - $processingTime = ($requestList->count() && $requestList->count() === 1) ? $process->bearbeitungszeit : null; + $processingTime = null; + if ($requestList->count()) { + $processingTime = $requestList->count() === 1 ? $process->bearbeitungszeit : null; + } else { + $requestList = [new \BO\Zmsentities\Request(['id' => '-1'])]; + } foreach ($requestList as $request) { $archived = true; // for verbose