Browse Source

创建订单-修复下单问题

sunxbiao 5 months ago
parent
commit
9dd67ef8c0
1 changed files with 18 additions and 0 deletions
  1. 18 0
      app/common/repositories/store/order/StoreOrderRepository.php

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

@@ -2530,6 +2530,24 @@ class StoreOrderRepository extends BaseRepository
2530 2530
                     ['type' => 'c1', 'price' => $orderpri, 'other' => 0, 'note' => "复购金"],
2531 2531
                 ];
2532 2532
 
2533
+            } else if ($store_product_datas['mer_id'] == CommonEnum::DESIGN_MERCHANT_ID['SharedProsperity']['code']) {
2534
+                $productSku = Db::name('store_product_attr_value')->where('product_id', $store_product_datas['product_id'])->order('price asc')->find();
2535
+
2536
+                /** @var SharedProsperityRecommendConfigRepository $sharedProsperityRecommendConfigRepository */
2537
+                $sharedProsperityRecommendConfigRepository = app()->make(SharedProsperityRecommendConfigRepository::class);
2538
+                $sharedProsperityRecommendConfigEntityByMaxRewardRatio = $sharedProsperityRecommendConfigRepository->getSharedProsperityRecommendConfigEntityByMaxRewardRatio();
2539
+                // 利润 减去 顶格的直推奖,剩下的是PV值
2540
+                $pvProportion = bcsub('1', bcdiv($sharedProsperityRecommendConfigEntityByMaxRewardRatio->getRewardRatio(), '100', 4), 2);
2541
+                $pv = bcmul($productSku['plate_mer_profit'], $pvProportion, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
2542
+
2543
+                $yanglao = bcmul($productSku['price'], 0.05, 2);
2544
+                $cartInfo['list'][$_k]['pv'] = $pv;
2545
+                $cartInfo['list'][$_k]['yanglao'] = $yanglao;
2546
+
2547
+                $cartInfo['list'][$_k]['fzone_paytype'] = [
2548
+                    ['type' => StoreOrderEnum::FZONE_PAY_TYPE['B6-Cash']['code'], 'price' => $orderpri, 'other' => 0, 'note' => StoreOrderEnum::FZONE_PAY_TYPE['B6-Cash']['name']],
2549
+                ];
2550
+
2533 2551
             } else {
2534 2552
                 // 商贸区
2535 2553
                 /** @var \app\common\repositories\merchant\MerchantRepository $merchant */