wesmiler 2 lat temu
rodzic
commit
d112497836
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      app/Services/Api/GoodsService.php

+ 4 - 0
app/Services/Api/GoodsService.php

@@ -170,6 +170,10 @@ class GoodsService extends BaseService
                 $info['detail_img'] = $info['detail_img']? json_decode($info['detail_img'], true) : [];
                 $info['detail_img'] = $info['detail_img']? json_decode($info['detail_img'], true) : [];
             }
             }
 
 
+            if(empty($info['detail_img'])){
+                $info['detail_img'] = [$info['main_img']];
+            }
+
             $supplyList = config('goods.supplyList');
             $supplyList = config('goods.supplyList');
             $info['supply_name'] = isset($supplyList[$info['supply_type']]) ? $supplyList[$info['supply_type']] : '';
             $info['supply_name'] = isset($supplyList[$info['supply_type']]) ? $supplyList[$info['supply_type']] : '';