Przeglądaj źródła

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

sunxbiao 5 miesięcy temu
rodzic
commit
b2e194f441

+ 11 - 0
app/common/repositories/store/product/ProductRepository.php

@@ -175,6 +175,12 @@ 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
+                }
182
+            }
183
+
178 184
             $pension = bcsub($data['attrValue'][0]['price'], bcmul($data['attrValue'][0]['price'], $data['commission'], 2), 2);
179 185
             if ($data['pension'] > $pension) {
180 186
                 return ['code' => 201, 'msg' => '养老金金额和佣金金额总和不能超过商品单价'];
@@ -265,6 +271,11 @@ class ProductRepository extends BaseRepository
265 271
                     $value['extension_one'] = $base_commission;
266 272
                 }
267 273
             }
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
+                }
278
+            }
268 279
             $param['attr'] = $data['attr'] ?? '';
269 280
             $param['attrValue'] = $data['attrValue'] ?? '';
270 281
             $param['cate'] = $data['mer_cate_id'] ?? '';