shish před 4 roky
rodič
revize
6c100d3636
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      console/controllers/MtController.php

+ 7 - 1
console/controllers/MtController.php

@@ -72,7 +72,13 @@ class MtController extends Controller
             }
             $current = GoodsClass::getByCondition(['mainId' => $mainId, 'spu' => $mtGoodsSpu], true);
             if (!empty($current)) {
-
+                $shopImg = [];
+                foreach ($imgArr as $imgUrl) {
+                    $shortUrl = httpUtil::downloadRemoteImg($sjId, $shopId, $imgUrl);
+                    $shopImg[] = $shortUrl;
+                }
+                $current->shopImg = json_encode($shopImg);
+                $current->save();
             } else {
                 $shopImg = [];
                 foreach ($imgArr as $imgUrl) {