Przeglądaj źródła

商户修改选品价格

xialei 1 rok temu
rodzic
commit
7f0ae4b344

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

@@ -1944,16 +1944,18 @@ class ProductRepository extends BaseRepository
1944 1944
                 ->where('product_id', $product_id)
1945 1945
                 ->select()->toArray();
1946 1946
             $attrInfo = array_column($attrInfo, null, 'gong_sku_id');
1947
-            $updateData = [];
1947
+            $updateData = [];   
1948 1948
             // 组装数据
1949 1949
             foreach ($skuArr as $key => $value) {
1950 1950
                 if (isset($attrInfo[$value['sku_id']])) {
1951
+
1951 1952
                     if ($value['edit_price'] > $attrInfo[$value['sku_id']]['gong_market_price']) {
1952 1953
                         // 上调价格计算创客利润
1953 1954
                         $diff = bcsub($value['edit_price'], $attrInfo[$value['sku_id']]['gong_market_price'], 2);
1954
-                        $diff_profit = bcmul($diff, 0.7, 2);
1955
+                        // $diff_profit = bcmul($diff, 0.7, 2);
1956
+                        $diff_profit = $diff;
1955 1957
                         $plate_mer_profit = bcadd($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff_profit, 2);
1956
-                    } else {
1958
+                    } else {    
1957 1959
                         // 下调价格计算创客利润
1958 1960
                         $diff = bcsub($attrInfo[$value['sku_id']]['gong_market_price'], $value['edit_price'], 2);
1959 1961
                         $plate_mer_profit = bcsub($attrInfo[$value['sku_id']]['gong_mer_profit'], $diff, 2);

+ 4 - 4
app/controller/merchant/gong/Goods.php

@@ -320,10 +320,10 @@ class Goods extends BaseController
320 320
                     'cost_price'=>$v['cost_price'],
321 321
                     'extension_one'=>5,
322 322
                     'gong_sku_id'=>$v['sku_id'],
323
-                    'gong_mer_profit' => $v['profit'],
323
+                    'gong_mer_profit' => $v['mer_profit'],
324 324
                     'gong_pension' => $v['yanglaojin'],
325 325
                     'gong_market_price' => $v['market_price'],
326
-                    'plate_mer_profit' => $v['profit']
326
+                    'plate_mer_profit' => $v['mer_profit']
327 327
                 ]);
328 328
                 $key='';
329 329
                 $num++;
@@ -357,10 +357,10 @@ class Goods extends BaseController
357 357
                     'cost_price'=>$v['cost_price'],
358 358
                     'extension_one'=>5,
359 359
                     'gong_sku_id'=>$v['sku_id'],
360
-                    'gong_mer_profit' => $v['profit'],
360
+                    'gong_mer_profit' => $v['mer_profit'],
361 361
                     'gong_pension' => $v['yanglaojin'],
362 362
                     'gong_market_price' => $v['market_price'],
363
-                    'plate_mer_profit' => $v['profit']
363
+                    'plate_mer_profit' => $v['mer_profit']
364 364
                 ]);
365 365
                 $key='';
366 366
                 $num++;