Explorar el Código

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

sunxbiao hace 5 meses
padre
commit
de3c5a59a6
Se han modificado 1 ficheros con 4 adiciones y 8 borrados
  1. 4 8
      app/common/repositories/store/product/ProductRepository.php

+ 4 - 8
app/common/repositories/store/product/ProductRepository.php

@@ -175,10 +175,8 @@ class ProductRepository extends BaseRepository
175 175
                 }
176 176
             }
177 177
 
178
-            if (!empty($data['icon_type'])) {
179
-                if (is_array($data['icon_type'])) {
180
-                    $data['icon_type'] = json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE);
181
-                }
178
+            if (is_array($data['icon_type'])) {
179
+                $data['icon_type'] = json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE);
182 180
             }
183 181
 
184 182
             $pension = bcsub($data['attrValue'][0]['price'], bcmul($data['attrValue'][0]['price'], $data['commission'], 2), 2);
@@ -271,10 +269,8 @@ class ProductRepository extends BaseRepository
271 269
                     $value['extension_one'] = $base_commission;
272 270
                 }
273 271
             }
274
-            if (!empty($data['icon_type'])) {
275
-                if (is_array($data['icon_type'])) {
276
-                    $data['icon_type'] = json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE);
277
-                }
272
+            if (is_array($data['icon_type'])) {
273
+                $data['icon_type'] = json_encode($data['icon_type'], JSON_UNESCAPED_UNICODE);
278 274
             }
279 275
             $param['attr'] = $data['attr'] ?? '';
280 276
             $param['attrValue'] = $data['attrValue'] ?? '';