shish 5 rokov pred
rodič
commit
20edf3ef01
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      app-ghs/controllers/ProductController.php

+ 4 - 1
app-ghs/controllers/ProductController.php

@@ -305,7 +305,10 @@ class ProductController extends BaseController
                 $shopAll = ShopClass::getAllShop($this->sjId);
                 $shopAll = ShopClass::getAllShop($this->sjId);
                 if (!empty($shopAll)) {
                 if (!empty($shopAll)) {
                     foreach ($shopAll as $currentShop) {
                     foreach ($shopAll as $currentShop) {
-                        $currentShopId = $currentShop->id;
+                        $currentShopId = $currentShop['id'] ?? 0;
+                        if (empty($currentShopId)) {
+                            continue;
+                        }
                         ProductClass::updateByCondition(['shopId' => $currentShopId, 'itemId' => $currentItemId], $upData);
                         ProductClass::updateByCondition(['shopId' => $currentShopId, 'itemId' => $currentItemId], $upData);
                     }
                     }
                 }
                 }