Bladeren bron

添加商品-增加icon展示类型

sunxbiao 5 maanden geleden
bovenliggende
commit
7c9d94c4f6
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      app/common/repositories/store/product/ProductRepository.php

+ 2 - 2
app/common/repositories/store/product/ProductRepository.php

@@ -177,7 +177,7 @@ class ProductRepository extends BaseRepository
177
             }
177
             }
178
 
178
 
179
             if (is_array($data['icon_type'])) {
179
             if (is_array($data['icon_type'])) {
180
-                $data['icon_type'] = json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE);
180
+                $data['icon_type'] = $data['icon_type'] ? json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE) : null;
181
             }
181
             }
182
 
182
 
183
             $pension = bcsub($data['attrValue'][0]['price'], bcmul($data['attrValue'][0]['price'], $data['commission'], 2), 2);
183
             $pension = bcsub($data['attrValue'][0]['price'], bcmul($data['attrValue'][0]['price'], $data['commission'], 2), 2);
@@ -271,7 +271,7 @@ class ProductRepository extends BaseRepository
271
                 }
271
                 }
272
             }
272
             }
273
             if (is_array($data['icon_type'])) {
273
             if (is_array($data['icon_type'])) {
274
-                $data['icon_type'] = json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE);
274
+                $data['icon_type'] = $data['icon_type'] ? json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE) : null;
275
             }
275
             }
276
             $param['attr'] = $data['attr'] ?? '';
276
             $param['attr'] = $data['attr'] ?? '';
277
             $param['attrValue'] = $data['attrValue'] ?? '';
277
             $param['attrValue'] = $data['attrValue'] ?? '';