gorden hace 9 meses
padre
commit
05a173dd57
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      app/admin/service/goods/GoodsService.php

+ 5 - 1
app/admin/service/goods/GoodsService.php

@@ -1397,7 +1397,11 @@ class GoodsService
             }
             if (!empty($params['goods_premisses'])) {
                 if (!empty($data['goods_attribute_json']) && !is_array($data['goods_attribute_json'])) {
-                    $data['goods_attribute_json'] = json_decode($data['goods_attribute_json'], true);
+                    if (is_json($data['goods_attribute_json'])) {
+                        $data['goods_attribute_json'] = json_decode($data['goods_attribute_json'], true);
+                    } else {
+                        $data['goods_attribute_json'] = [];
+                    }
                 } elseif (empty($data['goods_attribute_json'])) {
                     $data['goods_attribute_json'] = [];
                 }