]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
fix(ERP-245): add is_array check to second foreach in domru-cams
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Fri, 27 Feb 2026 22:06:19 +0000 (01:06 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Fri, 27 Feb 2026 22:06:19 +0000 (01:06 +0300)
Same TypeError fix for the second foreach loop that inserts data
into store_visitors table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
erp24/api1/views/cron/domru-cams.php

index 6c0c6d70153666bae8397f32edfac1cf78e20ed7..9e78fbcd6ba9869c8ace2c1f855e139e5483013e 100644 (file)
@@ -210,6 +210,9 @@ if ($sid == null) {
 
         // вносим в массив
         foreach ($maas["count"] ?? [] as $id => $arr) {
+            if (!is_array($arr)) {
+                continue;
+            }
             if (isset($revers[$arr["CameraName"]])) {
                 $store_id = $revers[$arr["CameraName"]];
                 $date_ar = explode(" ", $arr["DateTime"]);