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

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

@@ -381,6 +381,12 @@ class ProductRepository extends BaseRepository
381 381
         $pric = $stock = $ot_price = $cost = $dc_price = $concession_pri = 0;
382 382
         if (isset($data['attrValue']) && is_array($data['attrValue'])) {
383 383
             foreach ($data['attrValue'] as $value) {
384
+
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);
387
+                $value['gong_market_price'] = bcadd($value['cost'], $value['gong_mer_profit'], 2);
388
+                $value['plate_mer_profit'] = $value['gong_mer_profit'];
389
+
384 390
                 $sku = '';
385 391
                 if (isset($value['detail']) && is_array($value['detail'])) {
386 392
                     $sku = implode(',', $value['detail']);