Преглед изворни кода

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

sunxbiao пре 5 месеци
родитељ
комит
7c9d94c4f6
1 измењених фајлова са 2 додато и 2 уклоњено
  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 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 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 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 276
             $param['attr'] = $data['attr'] ?? '';
277 277
             $param['attrValue'] = $data['attrValue'] ?? '';