Explorar o código

四舍五入去除

xialei hai 1 ano
pai
achega
86d0019c6a

+ 164 - 164
app/common/repositories/store/order/StoreOrderRepository.php

@@ -694,7 +694,7 @@ class StoreOrderRepository extends BaseRepository
694
 //                         $mer_money += $moneys - $total_extension_one - $souxufees;
694
 //                         $mer_money += $moneys - $total_extension_one - $souxufees;
695
 //                         if ($cartInfo['mer_id'] == 290) {
695
 //                         if ($cartInfo['mer_id'] == 290) {
696
 //                             $moneys = bcsub($moneys, $souxufees, 3);
696
 //                             $moneys = bcsub($moneys, $souxufees, 3);
697
-//                             $moneys = round($moneys, 2);
697
+//                             $moneys = round($moneys, 2); 
698
 //                             $total_extension_one = bcmul($moneys, '0.52', 3);
698
 //                             $total_extension_one = bcmul($moneys, '0.52', 3);
699
 //                             $total_extension_one = round($total_extension_one, 2);
699
 //                             $total_extension_one = round($total_extension_one, 2);
700
 //                             $mer_money = bcmul($moneys, '0.40', 3);
700
 //                             $mer_money = bcmul($moneys, '0.40', 3);
@@ -1025,7 +1025,7 @@ class StoreOrderRepository extends BaseRepository
1025
                                 $le_yw_amount = 600;
1025
                                 $le_yw_amount = 600;
1026
                             }
1026
                             }
1027
 
1027
 
1028
-                            $ylj_pri = round($pv * 0.035, 2);
1028
+                            $ylj_pri = bcmul($pv, 0.035, 2);
1029
                             //$pv = round($pv * 0.35,2);
1029
                             //$pv = round($pv * 0.35,2);
1030
 
1030
 
1031
                             //分配养老金给消费者
1031
                             //分配养老金给消费者
@@ -2233,7 +2233,7 @@ class StoreOrderRepository extends BaseRepository
2233
 
2233
 
2234
             if ($store_product_datas['mer_id'] == 496) {
2234
             if ($store_product_datas['mer_id'] == 496) {
2235
 
2235
 
2236
-                $yanglao = round($num_yl * 0.035, 2);//给预下订单中的商品展示 养老金 显示作用
2236
+                $yanglao = bcmul($num_yl, 0.035, 2);//给预下订单中的商品展示 养老金 显示作用
2237
                 $cartInfo['list'][$_k]['yanglao'] = $yanglao;
2237
                 $cartInfo['list'][$_k]['yanglao'] = $yanglao;
2238
                 $pv = $num_yl;
2238
                 $pv = $num_yl;
2239
                 //$v['vr']=$v['price'];
2239
                 //$v['vr']=$v['price'];
@@ -2287,24 +2287,24 @@ class StoreOrderRepository extends BaseRepository
2287
 
2287
 
2288
 
2288
 
2289
                 //精彩生活和商贸区
2289
                 //精彩生活和商贸区
2290
-                $jf = $orderpri - round($store_product_datas['concession_pri'] * 0.3, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.3, 2);
2291
-                $jd = $orderpri - round($store_product_datas['concession_pri'] * 0.35, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.35, 2);
2290
+                $jf = $orderpri - bcmul($store_product_datas['concession_pri'], 0.3, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.3, 2);
2291
+                $jd = $orderpri - bcmul($store_product_datas['concession_pri'], 0.35, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.35, 2);
2292
                 if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
2292
                 if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
2293
-                    $yanglao = round($store_product_datas['concession_pri'] * 0.3, 2);
2294
-                    $pv = round($store_product_datas['concession_pri'] * 0.35, 2);
2293
+                    $yanglao = bcmul($store_product_datas['concession_pri'], 0.3, 2);
2294
+                    $pv = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2295
                     $srtArry['jfduihuan'] = $jf;
2295
                     $srtArry['jfduihuan'] = $jf;
2296
                     $srtArry['jdduihuan'] = $jd;
2296
                     $srtArry['jdduihuan'] = $jd;
2297
-                    $jifen = round($store_product_datas['concession_pri'] * 0.35, 2);
2298
-                    $gongxian = round($store_product_datas['concession_pri'] * 0.35, 2);
2299
-
2300
-                    $jcvr = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2301
-                    $jcjf = round($store_product_datas['concession_pri'] * 0.3, 2);
2302
-                    $jcprice = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2303
-                    $jcjf1 = round($store_product_datas['concession_pri'] * 0.3, 2);
2304
-                    $jcvr1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2305
-                    $jcjd = round($store_product_datas['concession_pri'] * 0.35, 2);
2306
-                    $jcprice1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2307
-                    $jcjd1 = round($store_product_datas['concession_pri'] * 0.35, 2);
2297
+                    $jifen = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2298
+                    $gongxian = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2299
+
2300
+                    $jcvr = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
2301
+                    $jcjf = bcmul($store_product_datas['concession_pri'], 0.3, 2);
2302
+                    $jcprice = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
2303
+                    $jcjf1 = bcmul($store_product_datas['concession_pri'], 0.3, 2);
2304
+                    $jcvr1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
2305
+                    $jcjd = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2306
+                    $jcprice1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
2307
+                    $jcjd1 = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2308
 
2308
 
2309
                     //var_dump($cartInfo['list'][$_k]);
2309
                     //var_dump($cartInfo['list'][$_k]);
2310
                     //支付组合
2310
                     //支付组合
@@ -2346,8 +2346,8 @@ class StoreOrderRepository extends BaseRepository
2346
 //                $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
2346
 //                $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
2347
 //                $pv = $productSku['plate_mer_profit']??0.00;
2347
 //                $pv = $productSku['plate_mer_profit']??0.00;
2348
                 //复购区
2348
                 //复购区
2349
-                $pv = round($orderpri * 0.3, 2);
2350
-                $yanglao = round($pv * 0.5, 2);//给预下订单中的商品展示 养老金 显示作用
2349
+                $pv = bcmul($orderpri, 0.3, 2);
2350
+                $yanglao = bcmul($pv, 0.5, 2);//给预下订单中的商品展示 养老金 显示作用
2351
                 $cartInfo['list'][$_k]['pv'] = $pv;
2351
                 $cartInfo['list'][$_k]['pv'] = $pv;
2352
                 $cartInfo['list'][$_k]['yanglao'] = $yanglao;
2352
                 $cartInfo['list'][$_k]['yanglao'] = $yanglao;
2353
 
2353
 
@@ -2362,24 +2362,24 @@ class StoreOrderRepository extends BaseRepository
2362
                 $tmpMerchantInfo = $merchant->get($store_product_datas['mer_id']);
2362
                 $tmpMerchantInfo = $merchant->get($store_product_datas['mer_id']);
2363
                 // 1企业2个体3个人
2363
                 // 1企业2个体3个人
2364
                 if ($tmpMerchantInfo && in_array($tmpMerchantInfo['type'], [2, 3])) {
2364
                 if ($tmpMerchantInfo && in_array($tmpMerchantInfo['type'], [2, 3])) {
2365
-                    $jf = $orderpri - round($store_product_datas['concession_pri'] * 0.3, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.3, 2);
2366
-                    $jd = $orderpri - round($store_product_datas['concession_pri'] * 0.35, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.35, 2);
2365
+                    $jf = $orderpri - bcmul($store_product_datas['concession_pri'], 0.3, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.3, 2);
2366
+                    $jd = $orderpri - bcmul($store_product_datas['concession_pri'], 0.35, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.35, 2);
2367
                     if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
2367
                     if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
2368
-                        $yanglao = round($store_product_datas['concession_pri'] * 0.3, 2);
2369
-                        $pv = round($store_product_datas['concession_pri'] * 0.35, 2);
2368
+                        $yanglao = bcmul($store_product_datas['concession_pri'], 0.3, 2);
2369
+                        $pv = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2370
                         $srtArry['jfduihuan'] = $jf;
2370
                         $srtArry['jfduihuan'] = $jf;
2371
                         $srtArry['jdduihuan'] = $jd;
2371
                         $srtArry['jdduihuan'] = $jd;
2372
-                        $jifen = round($store_product_datas['concession_pri'] * 0.35, 2);
2373
-                        $gongxian = round($store_product_datas['concession_pri'] * 0.35, 2);
2374
-
2375
-                        $jcvr = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2376
-                        $jcjf = round($store_product_datas['concession_pri'] * 0.3, 2);
2377
-                        $jcprice = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
2378
-                        $jcjf1 = round($store_product_datas['concession_pri'] * 0.3, 2);
2379
-                        $jcvr1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2380
-                        $jcjd = round($store_product_datas['concession_pri'] * 0.35, 2);
2381
-                        $jcprice1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
2382
-                        $jcjd1 = round($store_product_datas['concession_pri'] * 0.35, 2);
2372
+                        $jifen = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2373
+                        $gongxian = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2374
+
2375
+                        $jcvr = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
2376
+                        $jcjf = bcmul($store_product_datas['concession_pri'], 0.3, 2);
2377
+                        $jcprice = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
2378
+                        $jcjf1 = bcmul($store_product_datas['concession_pri'], 0.3, 2);
2379
+                        $jcvr1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
2380
+                        $jcjd = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2381
+                        $jcprice1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
2382
+                        $jcjd1 = bcmul($store_product_datas['concession_pri'], 0.35, 2);
2383
 
2383
 
2384
                         //var_dump($cartInfo['list'][$_k]);
2384
                         //var_dump($cartInfo['list'][$_k]);
2385
                         //支付组合
2385
                         //支付组合
@@ -3725,7 +3725,7 @@ class StoreOrderRepository extends BaseRepository
3725
 
3725
 
3726
         $sanfangfenpei = json_decode($systemvalueObj['value'], true);
3726
         $sanfangfenpei = json_decode($systemvalueObj['value'], true);
3727
 
3727
 
3728
-        $oldagefee = round($order['total_price'] * $sanfangfenpei['yanglaojin'], 2);
3728
+        $oldagefee = bcmul($order['total_price'], $sanfangfenpei['yanglaojin'], 2);
3729
         log::info("++{$order['total_price']}+返回佣金===={$oldagefee}");
3729
         log::info("++{$order['total_price']}+返回佣金===={$oldagefee}");
3730
         //当前已扣会费总额
3730
         //当前已扣会费总额
3731
 //            $oldagefee = $oldagefee-$dues;
3731
 //            $oldagefee = $oldagefee-$dues;
@@ -3745,7 +3745,7 @@ class StoreOrderRepository extends BaseRepository
3745
         // 添加推荐奖励
3745
         // 添加推荐奖励
3746
         log::info("推荐佣金kaishi");
3746
         log::info("推荐佣金kaishi");
3747
         //推荐养老金添加
3747
         //推荐养老金添加
3748
-        $pvfee = round($order['total_price'] * $sanfangfenpei['pv'], 2);
3748
+        $pvfee = bcmul($order['total_price'], $sanfangfenpei['pv'], 2);
3749
         $zijiUser = Db::name("user")->where('uid', $order["uid"])->find();
3749
         $zijiUser = Db::name("user")->where('uid', $order["uid"])->find();
3750
         $sprerdUser = Db::name("user")->where('uid', $zijiUser['spread_uid'])->find();
3750
         $sprerdUser = Db::name("user")->where('uid', $zijiUser['spread_uid'])->find();
3751
         //不为空的时候进行添加推荐奖励
3751
         //不为空的时候进行添加推荐奖励
@@ -3756,7 +3756,7 @@ class StoreOrderRepository extends BaseRepository
3756
             if ($sprerdUser["user_group"] > 1) {
3756
             if ($sprerdUser["user_group"] > 1) {
3757
                 //奖励推荐者养老金
3757
                 //奖励推荐者养老金
3758
                 //养老金比例是pv佣金的5%
3758
                 //养老金比例是pv佣金的5%
3759
-                $tuiguanyanglaojin = round($pvfee * 0.05, 2);
3759
+                $tuiguanyanglaojin = bcmul($pvfee, 0.05, 2);
3760
                 $tuimark = "推荐消费获得养老金" . $tuiguanyanglaojin;
3760
                 $tuimark = "推荐消费获得养老金" . $tuiguanyanglaojin;
3761
 
3761
 
3762
                 //end会费
3762
                 //end会费
@@ -3804,7 +3804,7 @@ class StoreOrderRepository extends BaseRepository
3804
                 $yongjinbili = 17;
3804
                 $yongjinbili = 17;
3805
             }
3805
             }
3806
 
3806
 
3807
-            $tuiguanyongjin = round($pvfee * $yongjinbili / 100, 2);
3807
+            $tuiguanyongjin = bcmul($pvfee, $yongjinbili / 100, 2);
3808
 
3808
 
3809
 
3809
 
3810
             $tuiYongmark = "推荐消费获得佣金" . $tuiguanyongjin;
3810
             $tuiYongmark = "推荐消费获得佣金" . $tuiguanyongjin;
@@ -3863,7 +3863,7 @@ class StoreOrderRepository extends BaseRepository
3863
         $sanfangfenpei = json_decode($systemvalueObj['value'], true);
3863
         $sanfangfenpei = json_decode($systemvalueObj['value'], true);
3864
 
3864
 
3865
         // @todo 消费者本人获得复购PV
3865
         // @todo 消费者本人获得复购PV
3866
-        $consumerRepurchaseareaestimateannuity = round($order['total_price'] * $sanfangfenpei['yanglaojin'], 2);
3866
+        $consumerRepurchaseareaestimateannuity = bcmul($order['total_price'], $sanfangfenpei['yanglaojin'], 2);
3867
         log::info("++{$order['total_price']}+返回佣金===={$consumerRepurchaseareaestimateannuity}");
3867
         log::info("++{$order['total_price']}+返回佣金===={$consumerRepurchaseareaestimateannuity}");
3868
         if ($consumerRepurchaseareaestimateannuity >= 0.01) {
3868
         if ($consumerRepurchaseareaestimateannuity >= 0.01) {
3869
             $this->add_bill(
3869
             $this->add_bill(
@@ -3879,7 +3879,7 @@ class StoreOrderRepository extends BaseRepository
3879
         $directThrustUserinfo = User::where('uid', $userinfo["spread_uid"])->find();
3879
         $directThrustUserinfo = User::where('uid', $userinfo["spread_uid"])->find();
3880
         if (!empty($directThrustUserinfo)) {
3880
         if (!empty($directThrustUserinfo)) {
3881
             // 直推养老金
3881
             // 直推养老金
3882
-            $directThrustEstimateannuity = round($order['total_price'] * $sanfangfenpei['direct_thrust_ratio'], 2);
3882
+            $directThrustEstimateannuity = bcmul($order['total_price'], $sanfangfenpei['direct_thrust_ratio'], 2);
3883
             if ($directThrustEstimateannuity >= 0.01) {
3883
             if ($directThrustEstimateannuity >= 0.01) {
3884
                 $this->add_bill(
3884
                 $this->add_bill(
3885
                     '养老金', $directThrustEstimateannuity, $directThrustUserinfo["uid"], "复购-直接推广者获得养老金" . $directThrustEstimateannuity,
3885
                     '养老金', $directThrustEstimateannuity, $directThrustUserinfo["uid"], "复购-直接推广者获得养老金" . $directThrustEstimateannuity,
@@ -3895,7 +3895,7 @@ class StoreOrderRepository extends BaseRepository
3895
             $indirectThrustUserinfo = User::where('uid', $directThrustUserinfo["spread_uid"])->find();
3895
             $indirectThrustUserinfo = User::where('uid', $directThrustUserinfo["spread_uid"])->find();
3896
             if (!empty($indirectThrustUserinfo)) {
3896
             if (!empty($indirectThrustUserinfo)) {
3897
                 // 间推养老金
3897
                 // 间推养老金
3898
-                $indirectThrustEstimateannuity = round($order['total_price'] * $sanfangfenpei['indirect_thrust_ratio'], 2);
3898
+                $indirectThrustEstimateannuity = bcmul($order['total_price'], $sanfangfenpei['indirect_thrust_ratio'], 2);
3899
                 if ($indirectThrustEstimateannuity >= 0.01) {
3899
                 if ($indirectThrustEstimateannuity >= 0.01) {
3900
                     $this->add_bill(
3900
                     $this->add_bill(
3901
                         '养老金', $indirectThrustEstimateannuity, $indirectThrustUserinfo["uid"], "复购-间接推广者获得养老金" . $indirectThrustEstimateannuity,
3901
                         '养老金', $indirectThrustEstimateannuity, $indirectThrustUserinfo["uid"], "复购-间接推广者获得养老金" . $indirectThrustEstimateannuity,
@@ -9540,8 +9540,8 @@ class StoreOrderRepository extends BaseRepository
9540
                 $job_par = json_decode($store_order_data['fzone_paytype'], true);
9540
                 $job_par = json_decode($store_order_data['fzone_paytype'], true);
9541
                 //if($job_par['note'] == "现金"){
9541
                 //if($job_par['note'] == "现金"){
9542
                 //普通消费者
9542
                 //普通消费者
9543
-                $ylj_pri = round($concession_pri * 0.3, 2);
9544
-                $pv = round($concession_pri * 0.35, 2);
9543
+                $ylj_pri = bcmul($concession_pri, 0.3, 2);
9544
+                $pv = bcmul($concession_pri, 0.35, 2);
9545
 
9545
 
9546
                 //分配养老金给消费者
9546
                 //分配养老金给消费者
9547
                 $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
9547
                 $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
@@ -9570,18 +9570,18 @@ class StoreOrderRepository extends BaseRepository
9570
 
9570
 
9571
                         // //给推广者分配佣金
9571
                         // //给推广者分配佣金
9572
                         $yj_amount = 0;
9572
                         $yj_amount = 0;
9573
-                        $ylj_amount = $spread_data['annuity'] + round($pv * 0.05, 2);
9573
+                        $ylj_amount = $spread_data['annuity'] + bcmul($pv, 0.05, 2);
9574
                         $ssf = 0;//变量
9574
                         $ssf = 0;//变量
9575
                         $yj_amount_90 = 0;//90%的佣金
9575
                         $yj_amount_90 = 0;//90%的佣金
9576
 
9576
 
9577
                         if ($spread_data['user_group'] == 2) {
9577
                         if ($spread_data['user_group'] == 2) {
9578
-                            $ssf = round($pv * $rate, 2);
9579
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
9580
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
9578
+                            $ssf = bcmul($pv, $rate, 2);
9579
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9580
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9581
 
9581
 
9582
 
9582
 
9583
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9584
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9583
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9584
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9585
 
9585
 
9586
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9586
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9587
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9587
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9590,12 +9590,12 @@ class StoreOrderRepository extends BaseRepository
9590
 
9590
 
9591
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9591
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9592
                         } else if ($spread_data['user_group'] == 3) {
9592
                         } else if ($spread_data['user_group'] == 3) {
9593
-                            $ssf = round($pv * $rate, 2);
9594
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
9595
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
9593
+                            $ssf = bcmul($pv, $rate, 2);
9594
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9595
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9596
 
9596
 
9597
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9598
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9597
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9598
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9599
 
9599
 
9600
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9600
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9601
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9601
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9603,12 +9603,12 @@ class StoreOrderRepository extends BaseRepository
9603
 
9603
 
9604
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9604
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9605
                         } else if ($spread_data['user_group'] == 4) {
9605
                         } else if ($spread_data['user_group'] == 4) {
9606
-                            $ssf = round($pv * $rate, 2);
9607
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
9608
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
9606
+                            $ssf = bcmul($pv, $rate, 2);
9607
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9608
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9609
 
9609
 
9610
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9611
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9610
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9611
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9612
 
9612
 
9613
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9613
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9614
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9614
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9616,13 +9616,13 @@ class StoreOrderRepository extends BaseRepository
9616
 
9616
 
9617
                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9617
                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9618
                         } else if ($spread_data['user_group'] == 5) {
9618
                         } else if ($spread_data['user_group'] == 5) {
9619
-                            $ssf = round($pv * $rate, 2);
9620
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
9621
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
9619
+                            $ssf = bcmul($pv, $rate, 2);
9620
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9621
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9622
                             // $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
9622
                             // $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
9623
 
9623
 
9624
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9625
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9624
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9625
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9626
 
9626
 
9627
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9627
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9628
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9628
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9630,12 +9630,12 @@ class StoreOrderRepository extends BaseRepository
9630
 
9630
 
9631
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9631
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9632
                         } else if ($spread_data['user_group'] == 6) {
9632
                         } else if ($spread_data['user_group'] == 6) {
9633
-                            $ssf = round($pv * $rate, 2);
9634
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
9635
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
9633
+                            $ssf = bcmul($pv, $rate, 2);
9634
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9635
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9636
 
9636
 
9637
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9638
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9637
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9638
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9639
 
9639
 
9640
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9640
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9641
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9641
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9643,13 +9643,13 @@ class StoreOrderRepository extends BaseRepository
9643
 
9643
 
9644
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9644
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
9645
                         } else if ($spread_data['user_group'] == 7) {
9645
                         } else if ($spread_data['user_group'] == 7) {
9646
-                            $ssf = round($pv * $rate, 2);
9647
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
9648
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
9646
+                            $ssf = bcmul($pv, $rate, 2);
9647
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9648
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9649
 
9649
 
9650
 
9650
 
9651
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9652
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9651
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9652
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9653
 
9653
 
9654
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9654
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9655
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9655
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9665,15 +9665,15 @@ class StoreOrderRepository extends BaseRepository
9665
                         // //推广佣金
9665
                         // //推广佣金
9666
                         $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
9666
                         $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
9667
                         //养老金
9667
                         //养老金
9668
-                        $this->bill_user_log($spread_data['uid'], round($pv * 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
9668
+                        $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . bcmul($pv, 0.05, 2), $store_order_data['mer_id'], 0);
9669
                     }
9669
                     }
9670
 
9670
 
9671
                     //普通用户推广人
9671
                     //普通用户推广人
9672
                     if ($spread_data['user_group'] == 1) {
9672
                     if ($spread_data['user_group'] == 1) {
9673
                         //给推广者分配佣金
9673
                         //给推广者分配佣金
9674
 
9674
 
9675
-                        $yj_amount_90 = round($pv * $rate, 2) * 0.9;
9676
-                        $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9675
+                        $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
9676
+                        $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9677
 
9677
 
9678
                         $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9678
                         $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9679
                         $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9679
                         $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9681,8 +9681,8 @@ class StoreOrderRepository extends BaseRepository
9681
 
9681
 
9682
                         //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
9682
                         //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
9683
 
9683
 
9684
-                        $con = $spread_data['contribute'] + round($pv * $rate, 2);
9685
-                        $score = $spread_data['score'] + round($pv * $rate, 2);
9684
+                        $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
9685
+                        $score = $spread_data['score'] + bcmul($pv, $rate, 2);
9686
 
9686
 
9687
                         //贡献值和积分
9687
                         //贡献值和积分
9688
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
9688
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
@@ -9693,7 +9693,7 @@ class StoreOrderRepository extends BaseRepository
9693
                         // 贡献值
9693
                         // 贡献值
9694
                         $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值");
9694
                         $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值");
9695
                         //积分
9695
                         //积分
9696
-                        $this->score_log($spread_data['uid'], round($pv * $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分");
9696
+                        $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分");
9697
                     }
9697
                     }
9698
                 }
9698
                 }
9699
 
9699
 
@@ -9708,8 +9708,8 @@ class StoreOrderRepository extends BaseRepository
9708
 
9708
 
9709
                         //给推广者分配佣金
9709
                         //给推广者分配佣金
9710
 
9710
 
9711
-                        $yj_amount_90 = round($pv * 0.05, 2) * 0.9;
9712
-                        $fgj_amount_10 = round($pv * 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9711
+                        $yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
9712
+                        $fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
9713
 
9713
 
9714
                         // $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
9714
                         // $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
9715
                         // $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
9715
                         // $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
@@ -9760,7 +9760,7 @@ class StoreOrderRepository extends BaseRepository
9760
                 $le_yw_amount = 600;
9760
                 $le_yw_amount = 600;
9761
             }
9761
             }
9762
 
9762
 
9763
-            $ylj_pri = round($pv * 0.035, 2);
9763
+            $ylj_pri = bcmul($pv, 0.035, 2);
9764
             //$pv = round($pv * 0.35,2);
9764
             //$pv = round($pv * 0.35,2);
9765
 
9765
 
9766
             //分配养老金给消费者
9766
             //分配养老金给消费者
@@ -9772,7 +9772,7 @@ class StoreOrderRepository extends BaseRepository
9772
 
9772
 
9773
             // Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
9773
             // Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
9774
 
9774
 
9775
-            $this->bill_user_log($user_data['uid'], round($pv * 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . round($pv * 0.035, 2), $store_order_data['mer_id']);
9775
+            $this->bill_user_log($user_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . bcmul($pv, 0.035, 2), $store_order_data['mer_id']);
9776
             $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1);
9776
             $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1);
9777
             $this->score_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送积分", 1);
9777
             $this->score_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送积分", 1);
9778
 
9778
 
@@ -9804,7 +9804,7 @@ class StoreOrderRepository extends BaseRepository
9804
                     $con = 0;//贡献值
9804
                     $con = 0;//贡献值
9805
                     $score = 0;//积分
9805
                     $score = 0;//积分
9806
                     //养老金
9806
                     //养老金
9807
-                    $uer_bill = $spread_data['annuity'] + round($pv * 0.035, 2);
9807
+                    $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035, 2);
9808
                     //$yongjin = $spread_data['brokerage_price'] + $le_yw_amount;
9808
                     //$yongjin = $spread_data['brokerage_price'] + $le_yw_amount;
9809
 
9809
 
9810
                     $yj_amount_90 = $le_yw_amount * 0.9;
9810
                     $yj_amount_90 = $le_yw_amount * 0.9;
@@ -9816,69 +9816,69 @@ class StoreOrderRepository extends BaseRepository
9816
 
9816
 
9817
                     if ($spread_data['user_group'] == 2) {
9817
                     if ($spread_data['user_group'] == 2) {
9818
 
9818
 
9819
-                        $con = $spread_data['contribute'] + round($pv * 0.07, 2);
9820
-                        $score = $spread_data['brokerage_price'] + round($pv * 0.07, 2);
9819
+                        $con = $spread_data['contribute'] + bcmul($pv, 0.07, 2);
9820
+                        $score = $spread_data['brokerage_price'] + bcmul($pv, 0.07, 2);
9821
                         //  Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9821
                         //  Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9822
 
9822
 
9823
                         //贡献值
9823
                         //贡献值
9824
                         // $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9824
                         // $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9825
                         //积分
9825
                         //积分
9826
-                        $this->score_log($spread_data['uid'], round($pv * 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9826
+                        $this->score_log($spread_data['uid'], bcmul($pv, 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9827
 
9827
 
9828
                     } else if ($spread_data['user_group'] == 3) {
9828
                     } else if ($spread_data['user_group'] == 3) {
9829
 
9829
 
9830
 
9830
 
9831
-                        $con = $spread_data['contribute'] + round($pv * 0.09, 2);
9832
-                        $score = $spread_data['brokerage_price'] + round($pv * 0.09, 2);
9831
+                        $con = $spread_data['contribute'] + bcmul($pv, 0.09, 2);
9832
+                        $score = $spread_data['brokerage_price'] + bcmul($pv, 0.09, 2);
9833
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9833
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9834
 
9834
 
9835
                         //贡献值
9835
                         //贡献值
9836
                         // $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9836
                         // $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9837
                         //积分
9837
                         //积分
9838
-                        $this->score_log($spread_data['uid'], round($pv * 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9838
+                        $this->score_log($spread_data['uid'], bcmul($pv, 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9839
 
9839
 
9840
 
9840
 
9841
                     } else if ($spread_data['user_group'] == 4) {
9841
                     } else if ($spread_data['user_group'] == 4) {
9842
-                        $con = $spread_data['contribute'] + round($pv * 0.11, 2);
9843
-                        $score = $spread_data['brokerage_price'] + round($pv * 0.11, 2);
9842
+                        $con = $spread_data['contribute'] + bcmul($pv, 0.11, 2);
9843
+                        $score = $spread_data['brokerage_price'] + bcmul($pv, 0.11, 2);
9844
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9844
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9845
 
9845
 
9846
                         //贡献值
9846
                         //贡献值
9847
                         //$this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9847
                         //$this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9848
                         //积分
9848
                         //积分
9849
-                        $this->score_log($spread_data['uid'], round($pv * 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9849
+                        $this->score_log($spread_data['uid'], bcmul($pv, 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9850
 
9850
 
9851
 
9851
 
9852
                     } else if ($spread_data['user_group'] == 5) {
9852
                     } else if ($spread_data['user_group'] == 5) {
9853
-                        $con = $spread_data['contribute'] + round($pv * 0.13, 2);
9854
-                        $score = $spread_data['brokerage_price'] + round($pv * 0.13, 2);
9853
+                        $con = $spread_data['contribute'] + bcmul($pv, 0.13, 2);
9854
+                        $score = $spread_data['brokerage_price'] + bcmul($pv, 0.13, 2);
9855
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9855
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9856
 
9856
 
9857
                         //贡献值
9857
                         //贡献值
9858
                         // $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9858
                         // $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9859
                         //积分
9859
                         //积分
9860
-                        $this->score_log($spread_data['uid'], round($pv * 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9860
+                        $this->score_log($spread_data['uid'], bcmul($pv, 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9861
 
9861
 
9862
                     } else if ($spread_data['user_group'] == 6) {
9862
                     } else if ($spread_data['user_group'] == 6) {
9863
-                        $con = $spread_data['contribute'] + round($pv * 0.15, 2);
9864
-                        $score = $spread_data['brokerage_price'] + round($pv * 0.15, 2);
9863
+                        $con = $spread_data['contribute'] + bcmul($pv, 0.15, 2);
9864
+                        $score = $spread_data['brokerage_price'] + bcmul($pv, 0.15, 2);
9865
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9865
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9866
 
9866
 
9867
                         //贡献值
9867
                         //贡献值
9868
                         // $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9868
                         // $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9869
                         //积分
9869
                         //积分
9870
-                        $this->score_log($spread_data['uid'], round($pv * 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9870
+                        $this->score_log($spread_data['uid'], bcmul($pv, 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9871
 
9871
 
9872
 
9872
 
9873
                     } else if ($spread_data['user_group'] == 7) {
9873
                     } else if ($spread_data['user_group'] == 7) {
9874
-                        $con = $spread_data['contribute'] + round($pv * 0.17, 2);
9875
-                        $score = $spread_data['brokerage_price'] + round($pv * 0.17, 2);
9874
+                        $con = $spread_data['contribute'] + bcmul($pv, 0.17, 2);
9875
+                        $score = $spread_data['brokerage_price'] + bcmul($pv, 0.17, 2);
9876
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9876
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
9877
 
9877
 
9878
                         //贡献值
9878
                         //贡献值
9879
                         //$this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9879
                         //$this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9880
                         //积分
9880
                         //积分
9881
-                        $this->score_log($spread_data['uid'], round($pv * 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9881
+                        $this->score_log($spread_data['uid'], bcmul($pv, 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9882
 
9882
 
9883
 
9883
 
9884
                     }
9884
                     }
@@ -9887,7 +9887,7 @@ class StoreOrderRepository extends BaseRepository
9887
                     $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
9887
                     $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
9888
 
9888
 
9889
                     //养老金
9889
                     //养老金
9890
-                    $this->bill_user_log($spread_data['uid'], round($pv * 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . round($pv * 0.035, 2), $store_order_data['mer_id']);
9890
+                    $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . round($pv * 0.035, 2), $store_order_data['mer_id']);
9891
                     //佣金
9891
                     //佣金
9892
                     $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
9892
                     $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
9893
                     //复购金
9893
                     //复购金
@@ -9899,11 +9899,11 @@ class StoreOrderRepository extends BaseRepository
9899
                 if ($spread_data['user_group'] == 1) {  
9899
                 if ($spread_data['user_group'] == 1) {  
9900
 
9900
 
9901
                     //获取贡献值和积分和佣金
9901
                     //获取贡献值和积分和佣金
9902
-                    $gx_jf = $spread_data['contribute'] + round($pv * 0.21, 2);
9902
+                    $gx_jf = $spread_data['contribute'] + bcmul($pv, 0.21, 2);
9903
 
9903
 
9904
 
9904
 
9905
-                    $yj_amount_90 = round($yj1 * 0.9, 2);
9906
-                    $fgj_amount_10 = round($yj1 * 0.1, 2);//推广者的佣金抽10%到个人复购金
9905
+                    $yj_amount_90 = bcmul($yj1, 0.9, 2);
9906
+                    $fgj_amount_10 = bcmul($yj1, 0.1, 2);//推广者的佣金抽10%到个人复购金
9907
 
9907
 
9908
                     $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9908
                     $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
9909
                     $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9909
                     $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -9911,8 +9911,8 @@ class StoreOrderRepository extends BaseRepository
9911
 
9911
 
9912
 
9912
 
9913
                     //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $gx_jf,'score'=> $gx_jf,'brokerage_price'=> $yj_amount,'fugou'=>$fgj_amount]);
9913
                     //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $gx_jf,'score'=> $gx_jf,'brokerage_price'=> $yj_amount,'fugou'=>$fgj_amount]);
9914
-                    $this->con_log($spread_data['uid'], round($pv * 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
9915
-                    $this->score_log($spread_data['uid'], round($pv * 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9914
+                    $this->con_log($spread_data['uid'], bcmul($pv, 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
9915
+                    $this->score_log($spread_data['uid'], bcmul($pv, 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
9916
                     //推广佣金
9916
                     //推广佣金
9917
                     $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
9917
                     $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
9918
                 }
9918
                 }
@@ -9924,7 +9924,7 @@ class StoreOrderRepository extends BaseRepository
9924
                 $spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
9924
                 $spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
9925
                 //$spread_data = Db::name('user')->where('uid',473)->find();
9925
                 //$spread_data = Db::name('user')->where('uid',473)->find();
9926
                 //养老金
9926
                 //养老金
9927
-                $uer_bill = $spread_data['annuity'] + round($pv * 0.035, 2);
9927
+                $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035, 2);
9928
 
9928
 
9929
 
9929
 
9930
                 $yj_amount_90 = $le_yw_amount * 0.9;
9930
                 $yj_amount_90 = $le_yw_amount * 0.9;
@@ -9935,7 +9935,7 @@ class StoreOrderRepository extends BaseRepository
9935
 
9935
 
9936
                 $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
9936
                 $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
9937
                 //养老金
9937
                 //养老金
9938
-                $this->bill_user_log($spread_data['uid'], round($pv * 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . round($pv * 0.035, 2), $store_order_data['mer_id']);
9938
+                $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . bcmul($pv, 0.035, 2), $store_order_data['mer_id']);
9939
                 //佣金
9939
                 //佣金
9940
                 $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
9940
                 $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
9941
                 //复购金
9941
                 //复购金
@@ -10009,8 +10009,8 @@ class StoreOrderRepository extends BaseRepository
10009
                 if (!empty($merchant_data) && !empty($merchant_user_data)) {
10009
                 if (!empty($merchant_data) && !empty($merchant_user_data)) {
10010
 
10010
 
10011
 
10011
 
10012
-                    $yj_amount_90 = round($pv * 0.035, 2) * 0.9;
10013
-                    $fgj_amount_10 = round($pv * 0.035, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10012
+                    $yj_amount_90 = bcmul($pv , 0.035, 2) * 0.9;
10013
+                    $fgj_amount_10 = bcmul($pv, 0.035, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10014
 
10014
 
10015
                     $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
10015
                     $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
10016
                     $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
10016
                     $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
@@ -10019,7 +10019,7 @@ class StoreOrderRepository extends BaseRepository
10019
 
10019
 
10020
                     // Db::name('user')->where('uid',$merchant_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
10020
                     // Db::name('user')->where('uid',$merchant_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
10021
                     //推广佣金
10021
                     //推广佣金
10022
-                    $this->bill_user_log($merchant_data['uid'], round($pv * 0.35, 2), $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . round($pv * 0.35, 2), $store_order_data['mer_id']);
10022
+                    $this->bill_user_log($merchant_data['uid'], bcmul($pv, 0.35, 2), $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . round($pv * 0.35, 2), $store_order_data['mer_id']);
10023
                 }
10023
                 }
10024
 
10024
 
10025
             }
10025
             }
@@ -10059,8 +10059,8 @@ class StoreOrderRepository extends BaseRepository
10059
             // 1企业2个体3个人
10059
             // 1企业2个体3个人
10060
             if ($merchantInfo && !empty($store_order_data) && in_array($merchantInfo['type'], [2, 3])) {
10060
             if ($merchantInfo && !empty($store_order_data) && in_array($merchantInfo['type'], [2, 3])) {
10061
                 //商家让利部分的拆分
10061
                 //商家让利部分的拆分
10062
-                $ylj_pri = round($concession_pri * 0.3, 2); // 让利部分30%给消费者做养老金
10063
-                $pv = round($concession_pri * 0.35, 2); // 35%做业绩PV分配
10062
+                $ylj_pri = bcmul($concession_pri, 0.3, 2); // 让利部分30%给消费者做养老金
10063
+                $pv = bcmul($concession_pri, 0.35, 2); // 35%做业绩PV分配
10064
 
10064
 
10065
                 //分配养老金给消费者
10065
                 //分配养老金给消费者
10066
                 $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
10066
                 $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
@@ -10087,24 +10087,24 @@ class StoreOrderRepository extends BaseRepository
10087
                         $yj_amount_90 = 0;//90%的佣金
10087
                         $yj_amount_90 = 0;//90%的佣金
10088
                         // 业务员
10088
                         // 业务员
10089
                         if ($spread_data['user_group'] == 2) {
10089
                         if ($spread_data['user_group'] == 2) {
10090
-                            $ssf = round($pv * $rate, 2);
10091
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
10092
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
10090
+                            $ssf = bcmul($pv, $rate, 2);
10091
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10092
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10093
 
10093
 
10094
 
10094
 
10095
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10096
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10095
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10096
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10097
 
10097
 
10098
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10098
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10099
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10099
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10100
                             $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
10100
                             $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
10101
                         } else if ($spread_data['user_group'] == 3) {
10101
                         } else if ($spread_data['user_group'] == 3) {
10102
-                            $ssf = round($pv * $rate, 2);
10103
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
10104
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
10102
+                            $ssf = bcmul($pv, $rate, 2);
10103
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10104
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10105
 
10105
 
10106
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10107
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10106
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10107
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10108
 
10108
 
10109
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10109
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10110
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10110
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -10112,12 +10112,12 @@ class StoreOrderRepository extends BaseRepository
10112
 
10112
 
10113
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10113
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10114
                         } else if ($spread_data['user_group'] == 4) {
10114
                         } else if ($spread_data['user_group'] == 4) {
10115
-                            $ssf = round($pv * $rate, 2);
10116
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
10117
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
10115
+                            $ssf = bcmul($pv, $rate, 2);
10116
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10117
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10118
 
10118
 
10119
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10120
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10119
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10120
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10121
 
10121
 
10122
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10122
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10123
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10123
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -10125,13 +10125,13 @@ class StoreOrderRepository extends BaseRepository
10125
 
10125
 
10126
                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10126
                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10127
                         } else if ($spread_data['user_group'] == 5) {
10127
                         } else if ($spread_data['user_group'] == 5) {
10128
-                            $ssf = round($pv * $rate, 2);
10129
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
10130
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
10128
+                            $ssf = bcmul($pv, $rate, 2);
10129
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10130
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10131
                             // $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
10131
                             // $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
10132
 
10132
 
10133
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10134
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10133
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10134
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10135
 
10135
 
10136
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10136
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10137
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10137
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -10139,12 +10139,12 @@ class StoreOrderRepository extends BaseRepository
10139
 
10139
 
10140
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10140
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10141
                         } else if ($spread_data['user_group'] == 6) {
10141
                         } else if ($spread_data['user_group'] == 6) {
10142
-                            $ssf = round($pv * $rate, 2);
10143
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
10144
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
10142
+                            $ssf = bcmul($pv, $rate, 2);
10143
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10144
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10145
 
10145
 
10146
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10147
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10146
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10147
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10148
 
10148
 
10149
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10149
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10150
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10150
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -10152,13 +10152,13 @@ class StoreOrderRepository extends BaseRepository
10152
 
10152
 
10153
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10153
                             // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
10154
                         } else if ($spread_data['user_group'] == 7) {
10154
                         } else if ($spread_data['user_group'] == 7) {
10155
-                            $ssf = round($pv * $rate, 2);
10156
-                            $con = $spread_data['contribute'] + round($pv * $rate, 2);
10157
-                            $score = $spread_data['score'] + round($pv * $rate, 2);
10155
+                            $ssf = bcmul($pv, $rate, 2);
10156
+                            $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10157
+                            $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10158
 
10158
 
10159
 
10159
 
10160
-                            $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10161
-                            $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10160
+                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10161
+                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10162
 
10162
 
10163
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10163
                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10164
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10164
                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -10174,15 +10174,15 @@ class StoreOrderRepository extends BaseRepository
10174
                         //推广佣金
10174
                         //推广佣金
10175
                         $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
10175
                         $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
10176
                         //养老金
10176
                         //养老金
10177
-                        $this->bill_user_log($spread_data['uid'], round($pv * 0.05, 2), $store_order_data['order_id'], 5, $group_order['group_order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
10177
+                        $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $group_order['group_order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
10178
                     }
10178
                     }
10179
 
10179
 
10180
                     //普通用户推广人
10180
                     //普通用户推广人
10181
                     if ($spread_data['user_group'] == 1) {
10181
                     if ($spread_data['user_group'] == 1) {
10182
                         //给推广者分配佣金
10182
                         //给推广者分配佣金
10183
 
10183
 
10184
-                        $yj_amount_90 = round($pv * $rate, 2) * 0.9;
10185
-                        $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10184
+                        $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
10185
+                        $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10186
 
10186
 
10187
                         $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10187
                         $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
10188
                         $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
10188
                         $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -10190,8 +10190,8 @@ class StoreOrderRepository extends BaseRepository
10190
 
10190
 
10191
                         //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
10191
                         //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
10192
 
10192
 
10193
-                        $con = $spread_data['contribute'] + round($pv * $rate, 2);
10194
-                        $score = $spread_data['score'] + round($pv * $rate, 2);
10193
+                        $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
10194
+                        $score = $spread_data['score'] + bcmul($pv, $rate, 2);
10195
 
10195
 
10196
                         //贡献值和积分
10196
                         //贡献值和积分
10197
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
10197
                         // Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
@@ -10201,7 +10201,7 @@ class StoreOrderRepository extends BaseRepository
10201
                         // 贡献值
10201
                         // 贡献值
10202
                         $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "推广商贸区商品赠送贡献值");
10202
                         $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "推广商贸区商品赠送贡献值");
10203
                         // 积分
10203
                         // 积分
10204
-                        $this->score_log($spread_data['uid'], round($pv * $rate, 2), $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
10204
+                        $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
10205
                     }
10205
                     }
10206
                 }
10206
                 }
10207
 
10207
 
@@ -10211,8 +10211,8 @@ class StoreOrderRepository extends BaseRepository
10211
                     $merchant_user_data = Db::name('user')->where('uid', $merchant_data['uid'])->find();
10211
                     $merchant_user_data = Db::name('user')->where('uid', $merchant_data['uid'])->find();
10212
                     if (!empty($merchant_user_data)) {
10212
                     if (!empty($merchant_user_data)) {
10213
                         //给推广者分配佣金
10213
                         //给推广者分配佣金
10214
-                        $yj_amount_90 = round($pv * 0.05, 2) * 0.9;
10215
-                        $fgj_amount_10 = round($pv * 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10214
+                        $yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
10215
+                        $fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
10216
 
10216
 
10217
                         $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
10217
                         $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
10218
                         $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
10218
                         $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
@@ -10227,7 +10227,7 @@ class StoreOrderRepository extends BaseRepository
10227
 
10227
 
10228
                     //商户获得贡献值
10228
                     //商户获得贡献值
10229
                     if ($concession_pri >= 0.01) {
10229
                     if ($concession_pri >= 0.01) {
10230
-                        $gonxian = round($concession_pri * $jdAndGonxianConfig['gonxian'], 2);
10230
+                        $gonxian = bcmul($concession_pri, $jdAndGonxianConfig['gonxian'], 2);
10231
                         $gongxian_data = [
10231
                         $gongxian_data = [
10232
                             "uid" => $merchant_data["uid"],
10232
                             "uid" => $merchant_data["uid"],
10233
                             "mer_id" => $user_data['mer_id'],
10233
                             "mer_id" => $user_data['mer_id'],
@@ -10249,7 +10249,7 @@ class StoreOrderRepository extends BaseRepository
10249
 
10249
 
10250
                     //商户获得京豆
10250
                     //商户获得京豆
10251
                     if ($concession_pri >= 0.01) {
10251
                     if ($concession_pri >= 0.01) {
10252
-                        $jd = round($concession_pri * $jdAndGonxianConfig['jd'], 2);
10252
+                        $jd = bcmul($concession_pri, $jdAndGonxianConfig['jd'], 2);
10253
                         $jd_data = [
10253
                         $jd_data = [
10254
                             "uid" => $merchant_data["uid"],
10254
                             "uid" => $merchant_data["uid"],
10255
                             "mer_id" => $user_data['mer_id'],
10255
                             "mer_id" => $user_data['mer_id'],
@@ -10312,7 +10312,7 @@ class StoreOrderRepository extends BaseRepository
10312
 
10312
 
10313
 
10313
 
10314
         //code...
10314
         //code...
10315
-        $pay_gb = round($orderInfo['num'] * $orderInfo['gb_num'], 2);
10315
+        $pay_gb = bcmul($orderInfo['num'], $orderInfo['gb_num'], 2);
10316
         //$pay_vr =  round($orderInfo['num'] * $orderInfo['vr_num'],2);
10316
         //$pay_vr =  round($orderInfo['num'] * $orderInfo['vr_num'],2);
10317
         //付款按照700的VR付款 start
10317
         //付款按照700的VR付款 start
10318
         $vr_num = 0;
10318
         $vr_num = 0;
@@ -10345,17 +10345,17 @@ class StoreOrderRepository extends BaseRepository
10345
 
10345
 
10346
             if ($goods_of_info['money'] == 1180) {
10346
             if ($goods_of_info['money'] == 1180) {
10347
                 //修改订单到账状态
10347
                 //修改订单到账状态
10348
-                $zs_ylj = round(700 * 0.05, 2);//计算的养老金 金额
10348
+                $zs_ylj = bcmul(700, 0.05, 2);//计算的养老金 金额
10349
             } elseif ($goods_of_info['money'] == 11800) {
10349
             } elseif ($goods_of_info['money'] == 11800) {
10350
-                $zs_ylj = round(7000 * 0.05, 2);//计算的养老金 金额
10350
+                $zs_ylj = bcmul(7000, 0.05, 2);//计算的养老金 金额
10351
             } elseif ($goods_of_info['money'] == 3540) {
10351
             } elseif ($goods_of_info['money'] == 3540) {
10352
-                $zs_ylj = round(2100 * 0.05, 2);//计算的养老金 金额
10352
+                $zs_ylj = bcmul(2100, 0.05, 2);//计算的养老金 金额
10353
             } elseif ($goods_of_info['money'] == 10620) {
10353
             } elseif ($goods_of_info['money'] == 10620) {
10354
-                $zs_ylj = round(6300 * 0.05, 2);//计算的养老金 金额
10354
+                $zs_ylj = bcmul(6300, 0.05, 2);//计算的养老金 金额
10355
             } elseif ($goods_of_info['money'] == 9440) {
10355
             } elseif ($goods_of_info['money'] == 9440) {
10356
-                $zs_ylj = round(5600 * 0.05, 2);//八单计算的养老金 金额
10356
+                $zs_ylj = bcmul(5600, 0.05, 2);//八单计算的养老金 金额
10357
             } elseif ($goods_of_info['money'] == 2360) {
10357
             } elseif ($goods_of_info['money'] == 2360) {
10358
-                $zs_ylj = round(1400 * 0.05, 2);//两单计算的养老金 金额
10358
+                $zs_ylj = bcmul(1400, 0.05, 2);//两单计算的养老金 金额
10359
             }
10359
             }
10360
 
10360
 
10361
 
10361
 

+ 66 - 66
app/controller/api/Notify.php

@@ -167,8 +167,8 @@ class Notify
167
                                     $job_par = json_decode($store_order_data['fzone_paytype'], true);
167
                                     $job_par = json_decode($store_order_data['fzone_paytype'], true);
168
                                     //if($job_par['note'] == "现金"){
168
                                     //if($job_par['note'] == "现金"){
169
                                     //普通消费者
169
                                     //普通消费者
170
-                                    $ylj_pri = round($concession_pri * 0.3,2);
171
-                                    $pv = round($concession_pri * 0.35,2);
170
+                                    $ylj_pri = bcmul($concession_pri, 0.3,2);
171
+                                    $pv = bcmul($concession_pri, 0.35,2);  
172
 
172
 
173
                                     //分配养老金给消费者
173
                                     //分配养老金给消费者
174
                                     $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
174
                                     $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
@@ -195,18 +195,18 @@ class Notify
195
 
195
 
196
                                             // //给推广者分配佣金
196
                                             // //给推广者分配佣金
197
                                             $yj_amount = 0;
197
                                             $yj_amount = 0;
198
-                                            $ylj_amount = $spread_data['annuity'] + round($pv * 0.05,2);
198
+                                            $ylj_amount = $spread_data['annuity'] + bcmul($pv, 0.05,2);
199
                                             $ssf = 0;//变量
199
                                             $ssf = 0;//变量
200
                                             $yj_amount_90 = 0;//90%的佣金
200
                                             $yj_amount_90 = 0;//90%的佣金
201
 
201
 
202
                                             if($spread_data['user_group'] == 2){
202
                                             if($spread_data['user_group'] == 2){
203
-                                                $ssf =round($pv * 0.07,2);
204
-                                                $con       = $spread_data['contribute'] + round($pv * 0.07,2);
205
-                                                $score     = $spread_data['score'] + round($pv * 0.07,2);
203
+                                                $ssf =bcmul($pv, 0.07,2);
204
+                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.07,2);
205
+                                                $score     = $spread_data['score'] + bcmul($pv, 0.07,2);
206
 
206
 
207
 
207
 
208
-                                                $yj_amount_90 = round($pv * 0.07,2) * 0.9;
209
-                                                $fgj_amount_10 = round($pv * 0.07,2) * 0.1;//推广者的佣金抽10%到个人复购金
208
+                                                $yj_amount_90 = bcmul($pv, 0.07,2) * 0.9;
209
+                                                $fgj_amount_10 = bcmul($pv, 0.07,2) * 0.1;//推广者的佣金抽10%到个人复购金
210
 
210
 
211
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
211
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
212
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
212
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -216,12 +216,12 @@ class Notify
216
 
216
 
217
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
217
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
218
                                             }else if($spread_data['user_group'] == 3){
218
                                             }else if($spread_data['user_group'] == 3){
219
-                                                $ssf =round($pv * 0.09,2);
220
-                                                $con       = $spread_data['contribute'] + round($pv * 0.09,2);
221
-                                                $score     = $spread_data['score'] + round($pv * 0.09,2);
219
+                                                $ssf =bcmul($pv, 0.09,2);
220
+                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.09,2);
221
+                                                $score     = $spread_data['score'] + bcmul($pv, 0.09,2);
222
 
222
 
223
-                                                $yj_amount_90 = round($pv * 0.09,2) * 0.9;
224
-                                                $fgj_amount_10 = round($pv * 0.09,2) * 0.1;//推广者的佣金抽10%到个人复购金
223
+                                                $yj_amount_90 = bcmul($pv, 0.09,2) * 0.9;
224
+                                                $fgj_amount_10 = bcmul($pv, 0.09,2) * 0.1;//推广者的佣金抽10%到个人复购金
225
 
225
 
226
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
226
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
227
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
227
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -229,13 +229,13 @@ class Notify
229
 
229
 
230
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
230
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
231
                                             }else if($spread_data['user_group'] == 4){
231
                                             }else if($spread_data['user_group'] == 4){
232
-                                                $ssf =round($pv * 0.11,2);
233
-                                                $con       = $spread_data['contribute'] + round($pv * 0.11,2);
234
-                                                $score     = $spread_data['score'] + round($pv * 0.11,2);
232
+                                                $ssf =bcmul($pv, 0.11,2);
233
+                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.11,2);
234
+                                                $score     = $spread_data['score'] + bcmul($pv, 0.11,2);
235
 
235
 
236
 
236
 
237
-                                                $yj_amount_90 = round($pv * 0.11,2) * 0.9;
238
-                                                $fgj_amount_10 = round($pv * 0.11,2) * 0.1;//推广者的佣金抽10%到个人复购金
237
+                                                $yj_amount_90 = bcmul($pv, 0.11,2) * 0.9;
238
+                                                $fgj_amount_10 = bcmul($pv, 0.11,2) * 0.1;//推广者的佣金抽10%到个人复购金
239
 
239
 
240
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
240
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
241
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
241
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -243,13 +243,13 @@ class Notify
243
 
243
 
244
                                                 //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
244
                                                 //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
245
                                             }else if($spread_data['user_group'] == 5){
245
                                             }else if($spread_data['user_group'] == 5){
246
-                                                $ssf =round($pv * 0.13,2);
247
-                                                $con       = $spread_data['contribute'] + round($pv * 0.13,2);
248
-                                                $score     = $spread_data['score'] + round($pv * 0.13,2);
246
+                                                $ssf =bcmul($pv, 0.13,2);
247
+                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.13,2);
248
+                                                $score     = $spread_data['score'] + bcmul($pv, 0.13,2);
249
                                                 // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.13,2);
249
                                                 // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.13,2);
250
 
250
 
251
-                                                $yj_amount_90 = round($pv * 0.13,2) * 0.9;
252
-                                                $fgj_amount_10 = round($pv * 0.13,2) * 0.1;//推广者的佣金抽10%到个人复购金
251
+                                                $yj_amount_90 = bcmul($pv, 0.13,2) * 0.9;
252
+                                                $fgj_amount_10 = bcmul($pv, 0.13,2) * 0.1;//推广者的佣金抽10%到个人复购金
253
 
253
 
254
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
254
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
255
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
255
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -257,13 +257,13 @@ class Notify
257
 
257
 
258
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
258
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
259
                                             }else if($spread_data['user_group'] == 6){
259
                                             }else if($spread_data['user_group'] == 6){
260
-                                                $ssf =round($pv * 0.15,2);
261
-                                                $con       = $spread_data['contribute'] + round($pv * 0.15,2);
262
-                                                $score     = $spread_data['score'] + round($pv * 0.15,2);
260
+                                                $ssf =bcmul($pv, 0.15,2);
261
+                                                $con       = $spread_data['contribute'] + bcmul($pv, 0.15,2);
262
+                                                $score     = $spread_data['score'] + bcmul($pv, 0.15,2);
263
                                                 // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.15,2);
263
                                                 // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.15,2);
264
 
264
 
265
-                                                $yj_amount_90 = round($pv * 0.15,2) * 0.9;
266
-                                                $fgj_amount_10 = round($pv * 0.15,2) * 0.1;//推广者的佣金抽10%到个人复购金
265
+                                                $yj_amount_90 = bcmul($pv, 0.15,2) * 0.9;
266
+                                                $fgj_amount_10 = bcmul($pv, 0.15,2) * 0.1;//推广者的佣金抽10%到个人复购金
267
 
267
 
268
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
268
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
269
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
269
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -271,13 +271,13 @@ class Notify
271
 
271
 
272
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
272
                                                 // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
273
                                             }else if($spread_data['user_group'] == 7){
273
                                             }else if($spread_data['user_group'] == 7){
274
-                                                $ssf =round($pv * 0.17,2);
275
-                                                $con       = $spread_data['contribute'] + round($pv * 0.17,2);
276
-                                                $score     = $spread_data['score'] + round($pv * 0.17,2);
274
+                                                $ssf =bcmul($pv, 0.17,2);
275
+                                                $con       = $spread_data['contribute'] + bcmul($pv * 0.17,2);
276
+                                                $score     = $spread_data['score'] + bcmul($pv, 0.17,2);
277
                                                 // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.17,2);
277
                                                 // $yj_amount = $spread_data['brokerage_price'] + round($pv * 0.17,2);
278
 
278
 
279
-                                                $yj_amount_90 = round($pv * 0.17,2) * 0.9;
280
-                                                $fgj_amount_10 = round($pv * 0.17,2) * 0.1;//推广者的佣金抽10%到个人复购金
279
+                                                $yj_amount_90 = bcmul($pv, 0.17,2) * 0.9;
280
+                                                $fgj_amount_10 = bcmul($pv, 0.17,2) * 0.1;//推广者的佣金抽10%到个人复购金
281
 
281
 
282
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
282
                                                 $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
283
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
283
                                                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -300,8 +300,8 @@ class Notify
300
                                         if($spread_data['user_group'] == 1){
300
                                         if($spread_data['user_group'] == 1){
301
                                             //给推广者分配佣金
301
                                             //给推广者分配佣金
302
                                             // $ylj_amount = $spread_data['annuity'] + round($pv * 0.3,2);
302
                                             // $ylj_amount = $spread_data['annuity'] + round($pv * 0.3,2);
303
-                                            $yj_amount_90 = round($pv * 0.21,2) * 0.9;
304
-                                            $fgj_amount_10 = round($pv * 0.21,2) * 0.1;//推广者的佣金抽10%到个人复购金
303
+                                            $yj_amount_90 = bcmul($pv, 0.21,2) * 0.9;
304
+                                            $fgj_amount_10 = bcmul($pv, 0.21,2) * 0.1;//推广者的佣金抽10%到个人复购金
305
 
305
 
306
                                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
306
                                             $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
307
                                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
307
                                             $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -309,8 +309,8 @@ class Notify
309
 
309
 
310
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
310
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
311
 
311
 
312
-                                            $con = $spread_data['contribute'] + round($pv * 0.21,2);
313
-                                            $score = $spread_data['score'] + round($pv * 0.21,2);
312
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.21,2);
313
+                                            $score = $spread_data['score'] + bcmul($pv, 0.21,2);
314
 
314
 
315
                                             //贡献值和积分
315
                                             //贡献值和积分
316
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
316
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
@@ -341,8 +341,8 @@ class Notify
341
                                             //$merchant_amount = $merchant_user_data['brokerage_price'] + round($pv * 0.05,2);
341
                                             //$merchant_amount = $merchant_user_data['brokerage_price'] + round($pv * 0.05,2);
342
                                             //给推广者分配佣金
342
                                             //给推广者分配佣金
343
 
343
 
344
-                                            $yj_amount_90 = round($pv * 0.05,2) * 0.9;
345
-                                            $fgj_amount_10 = round($pv * 0.05,2) * 0.1;//推广者的佣金抽10%到个人复购金
344
+                                            $yj_amount_90 = bcmul($pv, 0.05,2) * 0.9;
345
+                                            $fgj_amount_10 = bcmul($pv, 0.05,2) * 0.1;//推广者的佣金抽10%到个人复购金
346
 
346
 
347
                                             $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
347
                                             $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
348
                                             $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
348
                                             $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
@@ -398,7 +398,7 @@ class Notify
398
                                     $le_yw_amount = 600;
398
                                     $le_yw_amount = 600;
399
                                 }
399
                                 }
400
 
400
 
401
-                                $ylj_pri = round($pv * 0.035,2);
401
+                                $ylj_pri = bcmul($pv, 0.035,2);
402
                                 //$pv = round($pv * 0.35,2);
402
                                 //$pv = round($pv * 0.35,2);
403
 
403
 
404
                                 //分配养老金给消费者
404
                                 //分配养老金给消费者
@@ -446,7 +446,7 @@ class Notify
446
                                         $con =0;//贡献值
446
                                         $con =0;//贡献值
447
                                         $score = 0;//积分
447
                                         $score = 0;//积分
448
                                         //养老金
448
                                         //养老金
449
-                                        $uer_bill = $spread_data['annuity'] + round($pv * 0.035,2);
449
+                                        $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035,2);
450
 
450
 
451
 
451
 
452
                                         $yj_amount_90 = $le_yw_amount * 0.9;
452
                                         $yj_amount_90 = $le_yw_amount * 0.9;
@@ -460,8 +460,8 @@ class Notify
460
 
460
 
461
                                         if($spread_data['user_group'] == 2){
461
                                         if($spread_data['user_group'] == 2){
462
 
462
 
463
-                                            $con = $spread_data['contribute'] + round($pv * 0.07,2);
464
-                                            $score = $spread_data['brokerage_price'] + round($pv * 0.07,2);
463
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.07,2);
464
+                                            $score = $spread_data['brokerage_price'] + bcmul($pv, 0.07,2);
465
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
465
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
466
 
466
 
467
                                             //贡献值
467
                                             //贡献值
@@ -470,8 +470,8 @@ class Notify
470
                                             //$this->score_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
470
                                             //$this->score_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
471
 
471
 
472
                                         }else if($spread_data['user_group'] == 3){
472
                                         }else if($spread_data['user_group'] == 3){
473
-                                            $con = $spread_data['contribute'] + round($pv * 0.09,2);
474
-                                            $score = $spread_data['brokerage_price'] + round($pv * 0.09,2);
473
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.09,2);
474
+                                            $score = $spread_data['brokerage_price'] + bcmul($pv, 0.09,2);
475
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
475
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
476
 
476
 
477
                                             //贡献值
477
                                             //贡献值
@@ -481,8 +481,8 @@ class Notify
481
 
481
 
482
 
482
 
483
                                         }else if($spread_data['user_group'] == 4){
483
                                         }else if($spread_data['user_group'] == 4){
484
-                                            $con = $spread_data['contribute'] + round($pv * 0.11,2);
485
-                                            $score = $spread_data['brokerage_price'] + round($pv * 0.11,2);
484
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.11,2);
485
+                                            $score = $spread_data['brokerage_price'] + bcmul($pv, 0.11,2);
486
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
486
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
487
 
487
 
488
                                             //贡献值
488
                                             //贡献值
@@ -492,8 +492,8 @@ class Notify
492
 
492
 
493
 
493
 
494
                                         }else if($spread_data['user_group'] == 5){
494
                                         }else if($spread_data['user_group'] == 5){
495
-                                            $con = $spread_data['contribute'] + round($pv * 0.13,2);
496
-                                            $score = $spread_data['brokerage_price'] + round($pv * 0.13,2);
495
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.13,2);
496
+                                            $score = $spread_data['brokerage_price'] + bcmul($pv, 0.13,2);
497
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
497
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
498
 
498
 
499
                                             //贡献值
499
                                             //贡献值
@@ -502,8 +502,8 @@ class Notify
502
                                            // $this->score_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
502
                                            // $this->score_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
503
 
503
 
504
                                         }else if($spread_data['user_group'] == 6){
504
                                         }else if($spread_data['user_group'] == 6){
505
-                                            $con = $spread_data['contribute'] + round($pv * 0.15,2);
506
-                                            $score = $spread_data['brokerage_price'] + round($pv * 0.15,2);
505
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.15,2);
506
+                                            $score = $spread_data['brokerage_price'] + bcmul($pv, 0.15,2);
507
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
507
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
508
 
508
 
509
                                             //贡献值
509
                                             //贡献值
@@ -513,8 +513,8 @@ class Notify
513
 
513
 
514
 
514
 
515
                                         }else if($spread_data['user_group'] == 7){
515
                                         }else if($spread_data['user_group'] == 7){
516
-                                            $con = $spread_data['contribute'] + round($pv * 0.17,2);
517
-                                            $score = $spread_data['brokerage_price'] + round($pv * 0.17,2);
516
+                                            $con = $spread_data['contribute'] + bcmul($pv, 0.17,2);
517
+                                            $score = $spread_data['brokerage_price'] + bcmul($pv, 0.17,2);
518
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
518
                                             //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
519
 
519
 
520
                                             //贡献值
520
                                             //贡献值
@@ -549,12 +549,12 @@ class Notify
549
                                         // $this->bill_user_log($user_data['spread_uid'],round($pv * 0.01,2),$store_order_data['order_id'],3,$group_order['group_order_sn'],'推广获得拥金'.round($pv * 0.01,2),$store_order_data['mer_id']);
549
                                         // $this->bill_user_log($user_data['spread_uid'],round($pv * 0.01,2),$store_order_data['order_id'],3,$group_order['group_order_sn'],'推广获得拥金'.round($pv * 0.01,2),$store_order_data['mer_id']);
550
 
550
 
551
                                         //获取贡献值和积分和佣金
551
                                         //获取贡献值和积分和佣金
552
-                                        $gx_jf = $spread_data['contribute'] + round($pv * 0.21,2);
552
+                                        $gx_jf = $spread_data['contribute'] + bcmul($pv, 0.21,2);
553
 
553
 
554
                                         //$yj111 = $spread_data['brokerage_price'] + $yj1;
554
                                         //$yj111 = $spread_data['brokerage_price'] + $yj1;
555
 
555
 
556
-                                        $yj_amount_90 = round($yj1 * 0.9,2);
557
-                                        $fgj_amount_10 = round($yj1 * 0.1,2);//推广者的佣金抽10%到个人复购金
556
+                                        $yj_amount_90 = bcmul($yj1, 0.9,2);
557
+                                        $fgj_amount_10 = bcmul($yj1, 0.1,2);//推广者的佣金抽10%到个人复购金
558
 
558
 
559
                                         $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
559
                                         $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
560
                                         $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
560
                                         $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -579,7 +579,7 @@ class Notify
579
                                     // $spread_data = Db::name('user')->where('uid',473)->find();
579
                                     // $spread_data = Db::name('user')->where('uid',473)->find();
580
 
580
 
581
                                     //养老金
581
                                     //养老金
582
-                                    $uer_bill = $spread_data['annuity'] + round($pv * 0.035,2);
582
+                                    $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035,2);
583
 
583
 
584
 
584
 
585
                                     $yj_amount_90 = $le_yw_amount * 0.9;
585
                                     $yj_amount_90 = $le_yw_amount * 0.9;
@@ -625,8 +625,8 @@ class Notify
625
                                     if(!empty($merchant_user_data)){
625
                                     if(!empty($merchant_user_data)){
626
 
626
 
627
 
627
 
628
-                                        $yj_amount_90 = round($pv * 0.035,2) * 0.9;
629
-                                        $fgj_amount_10 = round($pv * 0.035,2) * 0.1;//推广者的佣金抽10%到个人复购金
628
+                                        $yj_amount_90 = bcmul($pv, 0.035,2) * 0.9;
629
+                                        $fgj_amount_10 = bcmul($pv, 0.035,2) * 0.1;//推广者的佣金抽10%到个人复购金
630
 
630
 
631
                                         $yj_amount = $merchant_data['brokerage_price'] + $yj_amount_90;
631
                                         $yj_amount = $merchant_data['brokerage_price'] + $yj_amount_90;
632
                                         $fgj_amount = $merchant_data['fugou'] + $fgj_amount_10;
632
                                         $fgj_amount = $merchant_data['fugou'] + $fgj_amount_10;
@@ -925,7 +925,7 @@ class Notify
925
 
925
 
926
 
926
 
927
         //code...
927
         //code...
928
-        $pay_gb =  round($orderInfo['num'] * $orderInfo['gb_num'],2);
928
+        $pay_gb =  bcmul($orderInfo['num'], $orderInfo['gb_num'],2);
929
         //$pay_vr =  round($orderInfo['num'] * $orderInfo['vr_num'],2);
929
         //$pay_vr =  round($orderInfo['num'] * $orderInfo['vr_num'],2);
930
         //付款按照700的VR付款 start
930
         //付款按照700的VR付款 start
931
         $vr_num = 0;
931
         $vr_num = 0;
@@ -959,17 +959,17 @@ class Notify
959
 
959
 
960
             if($orderInfo['price'] == 1180){
960
             if($orderInfo['price'] == 1180){
961
                 //修改订单到账状态
961
                 //修改订单到账状态
962
-                $zs_ylj = round(700 * 0.05,2);//计算的养老金 金额
962
+                $zs_ylj = bcmul(700, 0.05,2);//计算的养老金 金额
963
             }elseif($orderInfo['price'] == 11800){
963
             }elseif($orderInfo['price'] == 11800){
964
-                $zs_ylj = round(7000 * 0.05,2);//计算的养老金 金额
964
+                $zs_ylj = bcmul(7000, 0.05,2);//计算的养老金 金额
965
             }elseif($orderInfo['price'] == 3540){
965
             }elseif($orderInfo['price'] == 3540){
966
-                $zs_ylj = round(2100 * 0.05,2);//计算的养老金 金额
966
+                $zs_ylj = bcmul(2100, 0.05,2);//计算的养老金 金额
967
             }elseif($orderInfo['price'] == 10620){
967
             }elseif($orderInfo['price'] == 10620){
968
-                $zs_ylj = round(6300 * 0.05,2);//计算的养老金 金额
968
+                $zs_ylj = bcmul(6300, 0.05,2);//计算的养老金 金额
969
             }elseif($orderInfo['price'] == 9440){
969
             }elseif($orderInfo['price'] == 9440){
970
-                $zs_ylj = round(5600 * 0.05,2);//八单计算的养老金 金额
970
+                $zs_ylj = bcmul(5600, 0.05,2);//八单计算的养老金 金额
971
             }elseif($orderInfo['price'] == 2360){
971
             }elseif($orderInfo['price'] == 2360){
972
-                $zs_ylj = round(1400 * 0.05,2);//两单计算的养老金 金额
972
+                $zs_ylj = bcmul(1400, 0.05,2);//两单计算的养老金 金额
973
             }
973
             }
974
 
974
 
975
 
975