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

Merge branch 'dev-xpy' into dev

xupuyuan месяцев назад: 4
Родитель
Сommit
39a9971723
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      app/common/repositories/store/product/ProductRepository.php

+ 5 - 1
app/common/repositories/store/product/ProductRepository.php

@@ -418,8 +418,12 @@ class ProductRepository extends BaseRepository
418
                 $value['plate_mer_profit'] = $value['gong_mer_profit'];
418
                 $value['plate_mer_profit'] = $value['gong_mer_profit'];
419
 
419
 
420
                 $sku = '';
420
                 $sku = '';
421
-                if (isset($value['detail']) && is_array($value['detail'])) {
421
+                if (isset($value['detail']) && is_array($value['detail']) && count($value['detail']) > 0) {
422
                     $sku = implode(',', $value['detail']);
422
                     $sku = implode(',', $value['detail']);
423
+                } else {
424
+                    // 单规格情况,detail填充默认内容
425
+                    $value['detail'] = ['默认'];
426
+                    $sku = '默认';
423
                 }
427
                 }
424
                 $product_data = Db::name('store_product')->where('product_id', $id)->value('spu_id');
428
                 $product_data = Db::name('store_product')->where('product_id', $id)->value('spu_id');
425
                 if ($product_data) {
429
                 if ($product_data) {