Selaa lähdekoodia

解决分配福利分两遍的问题

sunxiaobiao 1 vuosi sitten
vanhempi
commit
78f0a64291

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

@@ -9862,31 +9862,31 @@ class StoreOrderRepository extends BaseRepository
9862 9862
                 $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金', $store_order_data['mer_id']);
9863 9863
             }
9864 9864
 
9865
-            if ($spread_data_old != 0) {
9866
-                //1.0jbp系统中,如果有用户升级会员,给推荐人贡献值(90%)和养老金(10%)
9867
-                $spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
9868
-
9869
-                $yj_amount_90 = $le_yw_amount * 0.9;
9870
-                $fgj_amount_10 = $le_yw_amount * 0.1;//推广者的佣金抽10%到个人复购金
9871
-
9872
-                $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 0, "推广会员专区商品赠送贡献值", 1);
9873
-                //养老金
9874
-                $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']);
9875
-                //佣金
9876
-                $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金', $store_order_data['mer_id']);
9877
-                //复购金
9878
-                $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
9879
-
9880
-                $orderInfo = [
9881
-                    'num' => 1,
9882
-                    'gb_num' => 1,
9883
-                    'price' => $store_product_data['price']
9884
-                ];
9885
-                $goods_of_info1 = Db::name("old_user_of_goods")->where("id", $store_order_data['user_of_goods_id'])->find();//用户的订单价格表
9886
-                if (!empty($goods_of_info1)) {
9887
-                    $this->member_update($orderInfo, $goods_of_info1, $user_data['uid']);
9888
-                }
9889
-            }
9865
+            // if ($spread_data_old != 0) {
9866
+            //     //1.0jbp系统中,如果有用户升级会员,给推荐人贡献值(90%)和养老金(10%)
9867
+            //     $spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
9868
+            //
9869
+            //     $yj_amount_90 = $le_yw_amount * 0.9;
9870
+            //     $fgj_amount_10 = $le_yw_amount * 0.1;//推广者的佣金抽10%到个人复购金
9871
+            //
9872
+            //     $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 0, "推广会员专区商品赠送贡献值", 1);
9873
+            //     //养老金
9874
+            //     $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']);
9875
+            //     //佣金
9876
+            //     $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金', $store_order_data['mer_id']);
9877
+            //     //复购金
9878
+            //     $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
9879
+            //
9880
+            //     $orderInfo = [
9881
+            //         'num' => 1,
9882
+            //         'gb_num' => 1,
9883
+            //         'price' => $store_product_data['price']
9884
+            //     ];
9885
+            //     $goods_of_info1 = Db::name("old_user_of_goods")->where("id", $store_order_data['user_of_goods_id'])->find();//用户的订单价格表
9886
+            //     if (!empty($goods_of_info1)) {
9887
+            //         $this->member_update($orderInfo, $goods_of_info1, $user_data['uid']);
9888
+            //     }
9889
+            // }
9890 9890
 
9891 9891
             //锁客收益 todo 会员专区不做锁客 20250415
9892 9892
 //            if ($user_data['mer_id'] != 0) {

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

@@ -338,7 +338,7 @@ class Notify
338 338
                                 //给推广者分配佣金(2.0系统中)
339 339
                            
340 340
                                  // if ($user_data['spread_uid'] != 0) {
341
-                                if ($user_data['uid'] > 611) {
341
+                                // if ($user_data['uid'] > 611) {
342 342
 
343 343
                                     $spread_data = Db::name('user')->where('uid',$user_data['spread_uid'])->find();
344 344
                                     $StoreOrderRepository = app()->make(StoreOrderRepository::class);
@@ -478,49 +478,49 @@ class Notify
478 478
 
479 479
 
480 480
 
481
-                                }else if($spread_data_old != 0){
482
-
483
-                                    //1.0jbp系统中,如果有用户升级会员,给推荐人贡献值(90%)和养老金(10%)
484
-
485
-                                    $spread_data = Db::name('user')->where('uid',$spread_data_old['id'])->find();
486
-                                    // $spread_data = Db::name('user')->where('uid',473)->find();
487
-
488
-                                    //养老金
489
-                                    $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035,2);
490
-
491
-
492
-                                    $yj_amount_90 = bcmul($le_yw_amount,0.9,2);
493
-                                    $fgj_amount_10 = bcmul($le_yw_amount,0.1,2);//推广者的佣金抽10%到个人复购金
494
-
495
-                                    $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
496
-                                    $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
497
-
498
-
499
-                                    $this->con_log($spread_data['uid'],round($gx_jf,2),$store_order_data['order_id'],0,"推广会员专区商品赠送贡献值",1);
500
-                                    //养老金
501
-                                    $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']);
502
-                                    //佣金
503
-                                    $this->bill_user_log($spread_data['uid'], $yj_amount_90,$store_order_data['order_id'],3,$store_order_data['order_sn'],'推广获得佣金',$store_order_data['mer_id']);
504
-                                    //复购金
505
-                                    $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1,1);
506
-
507
-       
508
-                                    $orderInfo=[
509
-                                        'num'=>1,
510
-                                        'gb_num'=>1,
511
-                                        'price'=>$store_product_data['price']
512
-                                    ];
513
-                                    $goods_of_info1 = Db::name("old_user_of_goods")->where("id", $store_order_data['user_of_goods_id'])->find();//用户的订单价格表
514
-
515
-                                    if(!empty($goods_of_info1)){
516
-                                       // $spread_data = Db::name('test_log')->insert(['note'=>"goodsofinf22222o:".json_encode($goods_of_info1)]);
517
-
518
-                                        $this->member_update($orderInfo,$goods_of_info1,$user_data['uid']);
519
-                                    }
520
-
521
-
522
-
523
-                                }
481
+                                // }else if($spread_data_old != 0){
482
+                                //
483
+                                //     //1.0jbp系统中,如果有用户升级会员,给推荐人贡献值(90%)和养老金(10%)
484
+                                //
485
+                                //     $spread_data = Db::name('user')->where('uid',$spread_data_old['id'])->find();
486
+                                //     // $spread_data = Db::name('user')->where('uid',473)->find();
487
+                                //
488
+                                //     //养老金
489
+                                //     $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035,2);
490
+                                //
491
+                                //
492
+                                //     $yj_amount_90 = bcmul($le_yw_amount,0.9,2);
493
+                                //     $fgj_amount_10 = bcmul($le_yw_amount,0.1,2);//推广者的佣金抽10%到个人复购金
494
+                                //
495
+                                //     $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
496
+                                //     $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
497
+                                //
498
+                                //
499
+                                //     $this->con_log($spread_data['uid'],round($gx_jf,2),$store_order_data['order_id'],0,"推广会员专区商品赠送贡献值",1);
500
+                                //     //养老金
501
+                                //     $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']);
502
+                                //     //佣金
503
+                                //     $this->bill_user_log($spread_data['uid'], $yj_amount_90,$store_order_data['order_id'],3,$store_order_data['order_sn'],'推广获得佣金',$store_order_data['mer_id']);
504
+                                //     //复购金
505
+                                //     $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1,1);
506
+                                //
507
+                                //
508
+                                //     $orderInfo=[
509
+                                //         'num'=>1,
510
+                                //         'gb_num'=>1,
511
+                                //         'price'=>$store_product_data['price']
512
+                                //     ];
513
+                                //     $goods_of_info1 = Db::name("old_user_of_goods")->where("id", $store_order_data['user_of_goods_id'])->find();//用户的订单价格表
514
+                                //
515
+                                //     if(!empty($goods_of_info1)){
516
+                                //        // $spread_data = Db::name('test_log')->insert(['note'=>"goodsofinf22222o:".json_encode($goods_of_info1)]);
517
+                                //
518
+                                //         $this->member_update($orderInfo,$goods_of_info1,$user_data['uid']);
519
+                                //     }
520
+                                //
521
+                                //
522
+                                //
523
+                                // }
524 524
 
525 525
                                 //锁客收益  todo 会员专区不做锁客 20250415
526 526
 //                                if($user_data['mer_id'] != 0){