Ver código fonte

命令行-修复拉取微唯宝商品逻辑

sunxbiao 6 meses atrás
pai
commit
0b0e994e54
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      app/command/WiwibaoProductSync.php

+ 4 - 2
app/command/WiwibaoProductSync.php

@@ -572,9 +572,11 @@ class WiwibaoProductSync extends Command
572 572
         $sliderImage = $spuIdInfo['detail_img_list'] ?: '[]';
573 573
         $image = $spuIdInfo['cover_url'] ?? '';
574 574
 
575
-        try {
575
+        if (is_string($sliderImage)) {
576 576
             $sliderImage = implode(',', json_decode($sliderImage, true));
577
-        } catch (\Exception $e) {
577
+        } else if (is_array($sliderImage)) {
578
+            $sliderImage = implode(',', $sliderImage);
579
+        } else {
578 580
             $sliderImage = $image;
579 581
         }
580 582