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

商户添加设置默认分润比例以防报错

xialei 1 год назад
Родитель
Сommit
580ac865eb
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/common/repositories/store/product/ProductRepository.php

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

@@ -381,7 +381,7 @@ class ProductRepository extends BaseRepository
381
         $pric = $stock = $ot_price = $cost = $dc_price = $concession_pri = 0;
381
         $pric = $stock = $ot_price = $cost = $dc_price = $concession_pri = 0;
382
         if (isset($data['attrValue']) && is_array($data['attrValue'])) {
382
         if (isset($data['attrValue']) && is_array($data['attrValue'])) {
383
             foreach ($data['attrValue'] as $value) {
383
             foreach ($data['attrValue'] as $value) {
384
-
384
+                $value['extension_one'] = $value['extension_one'] ?? 0;
385
                 $value['cost'] = bcsub($value['price'], bcmul($value['price'], $value['extension_one'] / 100, 2), 2);
385
                 $value['cost'] = bcsub($value['price'], bcmul($value['price'], $value['extension_one'] / 100, 2), 2);
386
                 $value['gong_mer_profit'] = bcmul($value['price'], $value['extension_one'] / 100, 2);
386
                 $value['gong_mer_profit'] = bcmul($value['price'], $value['extension_one'] / 100, 2);
387
                 $value['gong_market_price'] = bcadd($value['cost'], $value['gong_mer_profit'], 2);
387
                 $value['gong_market_price'] = bcadd($value['cost'], $value['gong_mer_profit'], 2);