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

Merge branch 'master' of https://git.bjtdba.com/shop/php

chengzhiyixia 1 год назад
Родитель
Сommit
be275b2cad

+ 2 - 0
app/common/repositories/store/order/StoreOrderRepository.php

@@ -2351,6 +2351,8 @@ class StoreOrderRepository extends BaseRepository
2351
 
2351
 
2352
                 }
2352
                 }
2353
             } else if ($store_product_datas['mer_id'] == 491) {
2353
             } else if ($store_product_datas['mer_id'] == 491) {
2354
+//                $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
2355
+//                $pv = $productSku['plate_mer_profit']??0.00;
2354
                 //复购区
2356
                 //复购区
2355
                 $pv = round($orderpri * 0.3, 2);
2357
                 $pv = round($orderpri * 0.3, 2);
2356
                 $yanglao = round($pv * 0.5, 2);//给预下订单中的商品展示 养老金 显示作用
2358
                 $yanglao = round($pv * 0.5, 2);//给预下订单中的商品展示 养老金 显示作用

+ 13 - 10
app/common/repositories/store/product/ProductRepository.php

@@ -428,8 +428,8 @@ class ProductRepository extends BaseRepository
428
                         "share_num"     => 0,
428
                         "share_num"     => 0,
429
                         "stock_num"     => 0,
429
                         "stock_num"     => 0,
430
                         "shares_num"    => 0,
430
                         "shares_num"    => 0,
431
+                        'gong_mer_profit' => $value['gong_mer_profit'] ?? 0.00,
431
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
432
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
432
-                        'gong_mer_price' => $value['gong_mer_price'] ?? 0.00,
433
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
433
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
434
                     ];
434
                     ];
435
                 } else {
435
                 } else {
@@ -455,8 +455,8 @@ class ProductRepository extends BaseRepository
455
                         "share_num"     => (isset($value['share_num']) && $value['share_num'] !== '') ? $value['share_num'] : 0,
455
                         "share_num"     => (isset($value['share_num']) && $value['share_num'] !== '') ? $value['share_num'] : 0,
456
                         "stock_num"     => (isset($value['stock_num']) && $value['stock_num'] !== '') ? $value['stock_num'] : 0,
456
                         "stock_num"     => (isset($value['stock_num']) && $value['stock_num'] !== '') ? $value['stock_num'] : 0,
457
                         "shares_num"    => (isset($value['shares_num']) && $value['shares_num'] !== '') ? $value['shares_num'] : 0,
457
                         "shares_num"    => (isset($value['shares_num']) && $value['shares_num'] !== '') ? $value['shares_num'] : 0,
458
+                        'gong_mer_profit' => $value['gong_mer_profit'] ?? 0.00,
458
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
459
                         'gong_market_price' => $value['gong_market_price'] ?? 0.00,
459
-                        'gong_mer_price' => $value['gong_mer_price'] ?? 0.00,
460
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
460
                         'plate_mer_profit' => $value['plate_mer_profit'] ?? 0.00,
461
                     ];
461
                     ];
462
                 }
462
                 }
@@ -1704,12 +1704,14 @@ class ProductRepository extends BaseRepository
1704
                 ];
1704
                 ];
1705
 
1705
 
1706
             }else if($product['mer_id'] == 439){
1706
             }else if($product['mer_id'] == 439){
1707
+                $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
1707
                 //精彩生活和商贸区
1708
                 //精彩生活和商贸区
1708
                 $jf = $product['price'] - round($product['concession_pri']*0.3, 2) . ' + ' . round($product['concession_pri']*0.3, 2);
1709
                 $jf = $product['price'] - round($product['concession_pri']*0.3, 2) . ' + ' . round($product['concession_pri']*0.3, 2);
1709
                 $jd = $product['price'] - round($product['concession_pri']*0.35, 2) . ' + ' . round($product['concession_pri']*0.35, 2);
1710
                 $jd = $product['price'] - round($product['concession_pri']*0.35, 2) . ' + ' . round($product['concession_pri']*0.35, 2);
1710
                 if($product['concession_pri'] !=null || $product['concession_pri'] !=0){
1711
                 if($product['concession_pri'] !=null || $product['concession_pri'] !=0){
1711
                     $yanglao = round($product['concession_pri'] * 0.3, 2);
1712
                     $yanglao = round($product['concession_pri'] * 0.3, 2);
1712
-                    $pv = round($product['concession_pri'] * 0.35, 2);
1713
+//                    $pv = round($product['concession_pri'] * 0.35, 2);
1714
+                    $pv = $productSku['plate_mer_profit']??0.00;
1713
                     $srtArry['jfduihuan'] =$jf;
1715
                     $srtArry['jfduihuan'] =$jf;
1714
                     $srtArry['jdduihuan'] = $jd;
1716
                     $srtArry['jdduihuan'] = $jd;
1715
                     $jifen = round($product['concession_pri'] * 0.35, 2);
1717
                     $jifen = round($product['concession_pri'] * 0.35, 2);
@@ -1749,8 +1751,11 @@ class ProductRepository extends BaseRepository
1749
 
1751
 
1750
                 }
1752
                 }
1751
             }else if($product['mer_id'] == 491){
1753
             }else if($product['mer_id'] == 491){
1752
-                $num_yl = $product['price'];
1753
-                $pv= $num_yl * 0.3;
1754
+//                $num_yl = $product['price'];
1755
+//                $pv= $num_yl * 0.3;
1756
+                // 获取商品sku
1757
+                $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
1758
+                $pv = $productSku['plate_mer_profit']??0.00;
1754
                 $yanglao = round($pv * 0.5, 2);
1759
                 $yanglao = round($pv * 0.5, 2);
1755
                 //$v['vr']=$v['price'];
1760
                 //$v['vr']=$v['price'];
1756
                 //1:为会员专区,
1761
                 //1:为会员专区,
@@ -1769,12 +1774,14 @@ class ProductRepository extends BaseRepository
1769
                 $merchantInfo = $merchant->get($product['mer_id']);
1774
                 $merchantInfo = $merchant->get($product['mer_id']);
1770
                 // 1企业2个体3个人
1775
                 // 1企业2个体3个人
1771
                 if ($merchantInfo && in_array($merchantInfo['type'],[2,3])) {
1776
                 if ($merchantInfo && in_array($merchantInfo['type'],[2,3])) {
1777
+                    $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
1772
                     //商贸区
1778
                     //商贸区
1773
                     $jf = $product['price'] - round($product['concession_pri']*0.3, 2) . ' + ' . round($product['concession_pri']*0.3, 2);
1779
                     $jf = $product['price'] - round($product['concession_pri']*0.3, 2) . ' + ' . round($product['concession_pri']*0.3, 2);
1774
                     $jd = $product['price'] - round($product['concession_pri']*0.35, 2) . ' + ' . round($product['concession_pri']*0.35, 2);
1780
                     $jd = $product['price'] - round($product['concession_pri']*0.35, 2) . ' + ' . round($product['concession_pri']*0.35, 2);
1775
                     if($product['concession_pri'] !=null || $product['concession_pri'] !=0){
1781
                     if($product['concession_pri'] !=null || $product['concession_pri'] !=0){
1776
                         $yanglao = round($product['concession_pri'] * 0.3, 2);
1782
                         $yanglao = round($product['concession_pri'] * 0.3, 2);
1777
-                        $pv = round($product['concession_pri'] * 0.35, 2);
1783
+//                        $pv = round($product['concession_pri'] * 0.35, 2);
1784
+                        $pv = $productSku['plate_mer_profit']??0.00;
1778
                         $srtArry['jfduihuan'] =$jf;
1785
                         $srtArry['jfduihuan'] =$jf;
1779
                         $srtArry['jdduihuan'] = $jd;
1786
                         $srtArry['jdduihuan'] = $jd;
1780
                         $jifen = round($product['concession_pri'] * 0.35, 2);
1787
                         $jifen = round($product['concession_pri'] * 0.35, 2);
@@ -1801,10 +1808,6 @@ class ProductRepository extends BaseRepository
1801
                     }
1808
                     }
1802
                 }
1809
                 }
1803
             }
1810
             }
1804
-
1805
-
1806
-
1807
-
1808
         }else{//线下商品
1811
         }else{//线下商品
1809
 
1812
 
1810
             if ($mer_id>0){
1813
             if ($mer_id>0){

+ 10 - 3
app/common/repositories/system/merchant/MerchantRepository.php

@@ -468,20 +468,27 @@ class MerchantRepository extends BaseRepository
468
                 ];
468
                 ];
469
 
469
 
470
             }else if($merId == 439 || $is_commercetrade){
470
             }else if($merId == 439 || $is_commercetrade){
471
+                // 获取商品sku
472
+                $productSku = Db::name('store_product_attr_value')->where('product_id', $v['product_id'])->order('price asc')->find();
471
                 //精彩生活和商贸区
473
                 //精彩生活和商贸区
472
                 $jf = $v['price'] - round($v['concession_pri']*0.3, 2) . ' + ' . round($v['concession_pri']*0.3, 2);
474
                 $jf = $v['price'] - round($v['concession_pri']*0.3, 2) . ' + ' . round($v['concession_pri']*0.3, 2);
473
                 $jd = $v['price'] - round($v['concession_pri']*0.35, 2) . ' + ' . round($v['concession_pri']*0.35, 2);
475
                 $jd = $v['price'] - round($v['concession_pri']*0.35, 2) . ' + ' . round($v['concession_pri']*0.35, 2);
474
                 if($v['concession_pri'] !=null || $v['concession_pri'] !=0){
476
                 if($v['concession_pri'] !=null || $v['concession_pri'] !=0){
475
                     $v['yanglao'] = round($v['concession_pri'] * 0.3, 2);
477
                     $v['yanglao'] = round($v['concession_pri'] * 0.3, 2);
476
-                    $v['pv'] = round($v['concession_pri'] * 0.35, 2);
478
+//                    $v['pv'] = round($v['concession_pri'] * 0.35, 2);
479
+                    $v['pv'] = $productSku['plate_mer_profit']??0.00;
477
                     $v['jfduihuan'] =$jf;
480
                     $v['jfduihuan'] =$jf;
478
                     $v['jdduihuan'] = $jd;
481
                     $v['jdduihuan'] = $jd;
479
                     $v['jifen'] = round($v['concession_pri'] * 0.35, 2);
482
                     $v['jifen'] = round($v['concession_pri'] * 0.35, 2);
480
                     $v['gongxian'] = round($v['concession_pri'] * 0.35, 2);
483
                     $v['gongxian'] = round($v['concession_pri'] * 0.35, 2);
481
                 }
484
                 }
482
             }else if($merId == 491){
485
             }else if($merId == 491){
483
-                $num_yl = $v['price'];
484
-                $pv= $num_yl * 0.3;
486
+                // 获取商品sku
487
+                $productSku = Db::name('store_product_attr_value')->where('product_id', $v['product_id'])->order('price asc')->find();
488
+                $pv = $productSku['plate_mer_profit']??0.00;
489
+
490
+//                $num_yl = $v['price'];
491
+//                $pv= $num_yl * 0.3;
485
                 $yanglao = round($pv * 0.5, 2);
492
                 $yanglao = round($pv * 0.5, 2);
486
                 $v['pv'] = $pv;
493
                 $v['pv'] = $pv;
487
                 $v['yanglao'] = $yanglao;
494
                 $v['yanglao'] = $yanglao;

+ 2 - 2
app/common/repositories/user/UserThirdRepository.php

@@ -298,7 +298,7 @@ class UserThirdRepository extends BaseRepository
298
     public function repurchaseAreaEstimateAnnuityOrder($order_id, $commission, $pid, $order_sn, $type, $table)
298
     public function repurchaseAreaEstimateAnnuityOrder($order_id, $commission, $pid, $order_sn, $type, $table)
299
     {
299
     {
300
         //用户商家信息
300
         //用户商家信息
301
-        $user_mer = $this->getMer($pid);
301
+//        $user_mer = $this->getMer($pid);
302
         try {
302
         try {
303
             $money=$commission;
303
             $money=$commission;
304
             //返佣比例
304
             //返佣比例
@@ -318,7 +318,7 @@ class UserThirdRepository extends BaseRepository
318
                 "order_sn"=>$order_sn,
318
                 "order_sn"=>$order_sn,
319
                 "order_id"=>$order_id,
319
                 "order_id"=>$order_id,
320
                 "uid"=>$pid,
320
                 "uid"=>$pid,
321
-                "mer_id"=>$user_mer,
321
+                "mer_id"=>Db::name("store_order")->where("order_id",$order_id)->value("mer_id"),
322
                 "total_price"=>$commission,
322
                 "total_price"=>$commission,
323
                 "extension_one"=>$extension_one,
323
                 "extension_one"=>$extension_one,
324
                 "type_shop"=>$type,
324
                 "type_shop"=>$type,