Просмотр исходного кода

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

sunxbiao месяцев назад: 5
Родитель
Сommit
de3c5a59a6
1 измененных файлов с 4 добавлено и 8 удалено
  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
             $pension = bcsub($data['attrValue'][0]['price'], bcmul($data['attrValue'][0]['price'], $data['commission'], 2), 2);
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
                     $value['extension_one'] = $base_commission;
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
             $param['attr'] = $data['attr'] ?? '';
275
             $param['attr'] = $data['attr'] ?? '';
280
             $param['attrValue'] = $data['attrValue'] ?? '';
276
             $param['attrValue'] = $data['attrValue'] ?? '';