|
|
@@ -9250,6 +9250,10 @@ class StoreOrderRepository extends BaseRepository
|
|
9250
|
9250
|
Db::name('user')->where("uid", $uid)->update(['per_contribute' => $con_data['per_contribute'] + $num]);
|
|
9251
|
9251
|
}
|
|
9252
|
9252
|
|
|
|
9253
|
+ if($pv > 0){
|
|
|
9254
|
+ Db::name('user')->where("uid", $uid)->update(['pv' => $con_data['pv'] + $pv]);
|
|
|
9255
|
+ }
|
|
|
9256
|
+
|
|
9253
|
9257
|
//if(count($spread_data) > 0){
|
|
9254
|
9258
|
// $all_ids = [];
|
|
9255
|
9259
|
// foreach($spread_data as $k=>$v){
|
|
|
@@ -9774,7 +9778,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9774
|
9778
|
// Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
|
|
9775
|
9779
|
|
|
9776
|
9780
|
$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']);
|
|
9777
|
|
- $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1, $pv);
|
|
|
9781
|
+ $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1, $gx_jf);
|
|
9778
|
9782
|
$this->score_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送积分", 1);
|
|
9779
|
9783
|
|
|
9780
|
9784
|
//查询下单用户上级身份(2.0新表用户)
|
|
|
@@ -9792,10 +9796,15 @@ class StoreOrderRepository extends BaseRepository
|
|
9792
|
9796
|
//给推广者分配养老金
|
|
9793
|
9797
|
//给推广者分配佣金
|
|
9794
|
9798
|
// if ($user_data['spread_uid'] != 0) {
|
|
9795
|
|
- if ($user_data['uid'] > 611) {
|
|
|
9799
|
+ // if ($user_data['uid'] > 611) {
|
|
9796
|
9800
|
|
|
9797
|
9801
|
|
|
|
9802
|
+ //查询下单用户上级身份
|
|
9798
|
9803
|
$spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
|
9804
|
+
|
|
|
9805
|
+ //业务员或以上的推荐人等级
|
|
|
9806
|
+ $rate = static::getUserGroupRate($spread_data['user_group']);
|
|
|
9807
|
+
|
|
9799
|
9808
|
//user_group=1是消费者,2:业务,3:业务经理,4:初级合伙人,5:中级合伙人,6:高级合伙人,7:董事
|
|
9800
|
9809
|
//业务或以上等级推广人
|
|
9801
|
9810
|
//获得养老金、佣金、贡献值和积分
|
|
|
@@ -9814,78 +9823,79 @@ class StoreOrderRepository extends BaseRepository
|
|
9814
|
9823
|
$yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9815
|
9824
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9816
|
9825
|
|
|
|
9826
|
+ $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9817
|
9827
|
|
|
9818
|
|
- if ($spread_data['user_group'] == 2) {
|
|
|
9828
|
+ // if ($spread_data['user_group'] == 2) {
|
|
9819
|
9829
|
|
|
9820
|
|
- $con = $spread_data['contribute'] + bcmul($pv, 0.07, 2);
|
|
9821
|
|
- $score = $spread_data['brokerage_price'] + bcmul($pv, 0.07, 2);
|
|
9822
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
|
9830
|
+ // $con = $spread_data['contribute'] + bcmul($pv, 0.07, 2);
|
|
|
9831
|
+ // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.07, 2);
|
|
|
9832
|
+ // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9823
|
9833
|
|
|
9824
|
|
- //贡献值
|
|
9825
|
|
- // $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9826
|
|
- //积分
|
|
9827
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9834
|
+ // //贡献值
|
|
|
9835
|
+ // // $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9836
|
+ // //积分
|
|
|
9837
|
+ // $this->score_log($spread_data['uid'], bcmul($pv, 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9828
|
9838
|
|
|
9829
|
|
- } else if ($spread_data['user_group'] == 3) {
|
|
|
9839
|
+ // } else if ($spread_data['user_group'] == 3) {
|
|
9830
|
9840
|
|
|
9831
|
9841
|
|
|
9832
|
|
- $con = $spread_data['contribute'] + bcmul($pv, 0.09, 2);
|
|
9833
|
|
- $score = $spread_data['brokerage_price'] + bcmul($pv, 0.09, 2);
|
|
9834
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
|
9842
|
+ // $con = $spread_data['contribute'] + bcmul($pv, 0.09, 2);
|
|
|
9843
|
+ // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.09, 2);
|
|
|
9844
|
+ // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9835
|
9845
|
|
|
9836
|
|
- //贡献值
|
|
9837
|
|
- // $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9838
|
|
- //积分
|
|
9839
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9846
|
+ // //贡献值
|
|
|
9847
|
+ // // $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9848
|
+ // //积分
|
|
|
9849
|
+ // $this->score_log($spread_data['uid'], bcmul($pv, 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9840
|
9850
|
|
|
9841
|
9851
|
|
|
9842
|
|
- } else if ($spread_data['user_group'] == 4) {
|
|
9843
|
|
- $con = $spread_data['contribute'] + bcmul($pv, 0.11, 2);
|
|
9844
|
|
- $score = $spread_data['brokerage_price'] + bcmul($pv, 0.11, 2);
|
|
9845
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
|
9852
|
+ // } else if ($spread_data['user_group'] == 4) {
|
|
|
9853
|
+ // $con = $spread_data['contribute'] + bcmul($pv, 0.11, 2);
|
|
|
9854
|
+ // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.11, 2);
|
|
|
9855
|
+ // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9846
|
9856
|
|
|
9847
|
|
- //贡献值
|
|
9848
|
|
- //$this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9849
|
|
- //积分
|
|
9850
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9857
|
+ // //贡献值
|
|
|
9858
|
+ // //$this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9859
|
+ // //积分
|
|
|
9860
|
+ // $this->score_log($spread_data['uid'], bcmul($pv, 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9851
|
9861
|
|
|
9852
|
9862
|
|
|
9853
|
|
- } else if ($spread_data['user_group'] == 5) {
|
|
9854
|
|
- $con = $spread_data['contribute'] + bcmul($pv, 0.13, 2);
|
|
9855
|
|
- $score = $spread_data['brokerage_price'] + bcmul($pv, 0.13, 2);
|
|
9856
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
|
9863
|
+ // } else if ($spread_data['user_group'] == 5) {
|
|
|
9864
|
+ // $con = $spread_data['contribute'] + bcmul($pv, 0.13, 2);
|
|
|
9865
|
+ // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.13, 2);
|
|
|
9866
|
+ // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9857
|
9867
|
|
|
9858
|
|
- //贡献值
|
|
9859
|
|
- // $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9860
|
|
- //积分
|
|
9861
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9868
|
+ // //贡献值
|
|
|
9869
|
+ // // $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9870
|
+ // //积分
|
|
|
9871
|
+ // $this->score_log($spread_data['uid'], bcmul($pv, 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9862
|
9872
|
|
|
9863
|
|
- } else if ($spread_data['user_group'] == 6) {
|
|
9864
|
|
- $con = $spread_data['contribute'] + bcmul($pv, 0.15, 2);
|
|
9865
|
|
- $score = $spread_data['brokerage_price'] + bcmul($pv, 0.15, 2);
|
|
9866
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
|
9873
|
+ // } else if ($spread_data['user_group'] == 6) {
|
|
|
9874
|
+ // $con = $spread_data['contribute'] + bcmul($pv, 0.15, 2);
|
|
|
9875
|
+ // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.15, 2);
|
|
|
9876
|
+ // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9867
|
9877
|
|
|
9868
|
|
- //贡献值
|
|
9869
|
|
- // $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9870
|
|
- //积分
|
|
9871
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9878
|
+ // //贡献值
|
|
|
9879
|
+ // // $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9880
|
+ // //积分
|
|
|
9881
|
+ // $this->score_log($spread_data['uid'], bcmul($pv, 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9872
|
9882
|
|
|
9873
|
9883
|
|
|
9874
|
|
- } else if ($spread_data['user_group'] == 7) {
|
|
9875
|
|
- $con = $spread_data['contribute'] + bcmul($pv, 0.17, 2);
|
|
9876
|
|
- $score = $spread_data['brokerage_price'] + bcmul($pv, 0.17, 2);
|
|
9877
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
|
9884
|
+ // } else if ($spread_data['user_group'] == 7) {
|
|
|
9885
|
+ // $con = $spread_data['contribute'] + bcmul($pv, 0.17, 2);
|
|
|
9886
|
+ // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.17, 2);
|
|
|
9887
|
+ // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9878
|
9888
|
|
|
9879
|
|
- //贡献值
|
|
9880
|
|
- //$this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9881
|
|
- //积分
|
|
9882
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9889
|
+ // //贡献值
|
|
|
9890
|
+ // //$this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9891
|
+ // //积分
|
|
|
9892
|
+ // $this->score_log($spread_data['uid'], bcmul($pv, 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9883
|
9893
|
|
|
9884
|
9894
|
|
|
9885
|
|
- }
|
|
|
9895
|
+ // }
|
|
9886
|
9896
|
Db::name('test_log')->insert(['note' => "走到这里4"]);//测试
|
|
9887
|
9897
|
//贡献值
|
|
9888
|
|
- $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
|
9898
|
+ $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, round($gx_jf, 2));
|
|
9889
|
9899
|
|
|
9890
|
9900
|
//养老金
|
|
9891
|
9901
|
$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']);
|
|
|
@@ -9893,14 +9903,13 @@ class StoreOrderRepository extends BaseRepository
|
|
9893
|
9903
|
$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']);
|
|
9894
|
9904
|
//复购金
|
|
9895
|
9905
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
9896
|
|
-
|
|
9897
|
9906
|
}
|
|
9898
|
9907
|
|
|
9899
|
9908
|
//普通的用户推广人
|
|
9900
|
9909
|
if ($spread_data['user_group'] == 1) {
|
|
9901
|
9910
|
|
|
9902
|
9911
|
//获取贡献值和积分和佣金
|
|
9903
|
|
- $gx_jf = $spread_data['contribute'] + bcmul($pv, 0.21, 2);
|
|
|
9912
|
+ $gx_jf = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9904
|
9913
|
|
|
9905
|
9914
|
|
|
9906
|
9915
|
$yj_amount_90 = bcmul($yj1, 0.9, 2);
|
|
|
@@ -9912,14 +9921,15 @@ class StoreOrderRepository extends BaseRepository
|
|
9912
|
9921
|
|
|
9913
|
9922
|
|
|
9914
|
9923
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $gx_jf,'score'=> $gx_jf,'brokerage_price'=> $yj_amount,'fugou'=>$fgj_amount]);
|
|
9915
|
|
- $this->con_log($spread_data['uid'], bcmul($pv, 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
9916
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9924
|
+ $this->con_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, bcmul($pv, 0.21, 2));
|
|
|
9925
|
+ $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9917
|
9926
|
//推广佣金
|
|
9918
|
9927
|
$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']);
|
|
9919
|
9928
|
}
|
|
9920
|
9929
|
|
|
9921
|
9930
|
|
|
9922
|
|
- } else if ($spread_data_old != 0) {
|
|
|
9931
|
+ // } else if ($spread_data_old != 0) {
|
|
|
9932
|
+ if ($spread_data_old != 0) {
|
|
9923
|
9933
|
|
|
9924
|
9934
|
//1.0jbp系统中,如果有用户升级会员,给推荐人贡献值(90%)和养老金(10%)
|
|
9925
|
9935
|
$spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
|
|
|
@@ -9934,7 +9944,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9934
|
9944
|
$yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9935
|
9945
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9936
|
9946
|
|
|
9937
|
|
- $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
|
9947
|
+ $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, round($gx_jf, 2));
|
|
9938
|
9948
|
//养老金
|
|
9939
|
9949
|
$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']);
|
|
9940
|
9950
|
//佣金
|