Преглед изворни кода

精彩生活区商贸区回调å支付奖励做舍去

hefei пре 1 година
родитељ
комит
4a59836442
1 измењених фајлова са 14 додато и 52 уклоњено
  1. 14 52
      app/controller/api/Notify.php

+ 14 - 52
app/controller/api/Notify.php

@@ -198,8 +198,8 @@ class Notify
198 198
                                         $StoreOrderRepository = app()->make(StoreOrderRepository::class);
199 199
                                         $rate = $StoreOrderRepository->getUserGroupRate($spread_data['user_group']);
200 200
                                     if ($spread_data['user_group'] == 1) {
201
-                                        $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
202
-                                        $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
201
+                                        $yj_amount_90 = bcmul($pv * 0.9, $rate, 2);
202
+                                        $fgj_amount_10 = bcmul($pv * 0.1, $rate, 2);//推广者的佣金抽10%到个人复购金
203 203
 
204 204
                                         $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
205 205
 
@@ -213,8 +213,8 @@ class Notify
213 213
                                     } else if ($spread_data['user_group'] > 1) {
214 214
 
215 215
                                         $ssf = bcmul($pv, $rate, 2);
216
-                                        $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
217
-                                        $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
216
+                                        $yj_amount_90 = bcmul($pv * 0.9, $rate, 2);
217
+                                        $fgj_amount_10 = bcmul($pv * 0.1, $rate, 2);//推广者的佣金抽10%到个人复购金
218 218
                                         $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
219 219
 
220 220
                                         //贡献值
@@ -481,8 +481,8 @@ class Notify
481 481
                                     $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035,2);
482 482
 
483 483
 
484
-                                    $yj_amount_90 = $le_yw_amount * 0.9;
485
-                                    $fgj_amount_10 = $le_yw_amount * 0.1;//推广者的佣金抽10%到个人复购金
484
+                                    $yj_amount_90 = bcmul($le_yw_amount,0.9,2);
485
+                                    $fgj_amount_10 = bcmul($le_yw_amount,0.1,2);//推广者的佣金抽10%到个人复购金
486 486
 
487 487
                                     $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
488 488
                                     $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
@@ -524,8 +524,8 @@ class Notify
524 524
                                     if(!empty($merchant_user_data)){
525 525
 
526 526
 
527
-                                        $yj_amount_90 = bcmul($pv, 0.035,2) * 0.9;
528
-                                        $fgj_amount_10 = bcmul($pv, 0.035,2) * 0.1;//推广者的佣金抽10%到个人复购金
527
+                                        $yj_amount_90 = bcmul($pv * 0.9, 0.035,2);
528
+                                        $fgj_amount_10 = bcmul($pv * 0.1, 0.035,2);//推广者的佣金抽10%到个人复购金
529 529
 
530 530
                                         $yj_amount = $merchant_data['brokerage_price'] + $yj_amount_90;
531 531
                                         $fgj_amount = $merchant_data['fugou'] + $fgj_amount_10;
@@ -635,8 +635,8 @@ class Notify
635 635
                                         $StoreOrderRepository = app()->make(StoreOrderRepository::class);
636 636
                                         $rate = $StoreOrderRepository->getUserGroupRate($spread_data['user_group']);
637 637
                                         if ($spread_data['user_group'] == 1) {
638
-                                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
639
-                                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
638
+                                            $yj_amount_90 = bcmul($pv * 0.9, $rate, 2);
639
+                                            $fgj_amount_10 = bcmul($pv * 0.1, $rate, 2);//推广者的佣金抽10%到个人复购金
640 640
 
641 641
                                             $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
642 642
 
@@ -650,8 +650,8 @@ class Notify
650 650
                                         } else if ($spread_data['user_group'] > 1) {
651 651
 
652 652
                                             $ssf = bcmul($pv, $rate, 2);
653
-                                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
654
-                                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
653
+                                            $yj_amount_90 = bcmul($pv * 0.9, $rate, 2);
654
+                                            $fgj_amount_10 = bcmul($pv * 0.1, $rate, 2);//推广者的佣金抽10%到个人复购金
655 655
                                             $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
656 656
 
657 657
                                             //贡献值
@@ -664,44 +664,6 @@ class Notify
664 664
                                             $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);
665 665
                                         }
666 666
                                     }
667
-//                                    if ($user_data['spread_uid'] != 0) {
668
-//                                        //查询下单用户上级
669
-//                                        $spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
670
-//                                        /** @var \app\common\repositories\store\order\StoreOrderRepository $StoreOrderRepository */
671
-//                                        $rate = $StoreOrderRepository->getUserGroupRate($spread_data['user_group']);
672
-//                                        if ($spread_data['user_group'] > 1) {
673
-//                                            $ssf = bcmul($pv, $rate, 2);
674
-//                                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
675
-//                                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
676
-//                                            $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
677
-//
678
-//                                            //贡献值
679
-//                                            $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "推广商贸区商品赠送贡献值");
680
-//                                            //积分
681
-//                                            $this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
682
-//                                            //推广佣金
683
-//                                            $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);
684
-//                                            //养老金
685
-//                                            $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);
686
-//                                        }
687
-//
688
-//                                        //普通用户推广人
689
-//                                        if ($spread_data['user_group'] == 1) {
690
-//                                            //给推广者分配佣金
691
-//
692
-//                                            $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
693
-//                                            $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
694
-//
695
-//                                            $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
696
-//
697
-//                                            //推广佣金
698
-//                                            $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);
699
-//                                            // 贡献值
700
-//                                            $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "推广商贸区商品赠送贡献值");
701
-//                                            // 积分
702
-//                                            $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
703
-//                                        }
704
-//                                    }
705 667
 
706 668
                                     //锁客收益
707 669
                                     if ($user_data['mer_id'] != 0) {
@@ -709,8 +671,8 @@ class Notify
709 671
                                         $merchant_user_data = Db::name('user')->where('uid', $merchant_data['uid'])->find();
710 672
                                         if (!empty($merchant_user_data)) {
711 673
                                             //给推广者分配佣金
712
-                                            $yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
713
-                                            $fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
674
+                                            $yj_amount_90 = bcmul($pv * 0.9, 0.05, 2);
675
+                                            $fgj_amount_10 = bcmul($pv * 0.1, 0.05, 2);//推广者的佣金抽10%到个人复购金
714 676
                                             $this->fugou_user_log($merchant_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
715 677
                                             //推广佣金
716 678
                                             $this->bill_user_log($merchant_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);