|
|
@@ -2403,7 +2403,7 @@ class StoreOrderRepository extends BaseRepository
|
|
2403
|
2403
|
// ['type' => 'b1', 'price' => $jcvr, 'other' => $jcjf, 'note' => "VR+积分"],
|
|
2404
|
2404
|
['type' => 'b2', 'price' => $jcprice, 'other' => $jcjf1, "note" => "现金+积分"],
|
|
2405
|
2405
|
// ['type'=>'b3','price'=>$jcvr1,'other'=>$jcjd,"note"=>"VR+京豆"],
|
|
2406
|
|
- ['type' => 'b4', 'price' => $jcvr1, 'other' => $jcjd, "note" => "现金+京豆"],
|
|
|
2406
|
+// ['type' => 'b4', 'price' => $jcvr1, 'other' => $jcjd, "note" => "现金+京豆"],
|
|
2407
|
2407
|
// ['type' => 'b5', 'price' => $orderpri, 'other' => 0, "note" => "VR"],
|
|
2408
|
2408
|
['type' => 'b6', 'price' => $orderpri, 'other' => 0, "note" => "现金"],
|
|
2409
|
2409
|
|
|
|
@@ -9253,23 +9253,28 @@ class StoreOrderRepository extends BaseRepository
|
|
9253
|
9253
|
return $group;
|
|
9254
|
9254
|
}
|
|
9255
|
9255
|
|
|
9256
|
|
- public function con_log_pv($uid, $num, $order_id, $order_type, $mark, $status = -1)
|
|
|
9256
|
+ public function con_log_pv($uid, $pv, $order_id, $order_type, $mark, $status = -1)
|
|
9257
|
9257
|
{
|
|
9258
|
9258
|
// 添加pv记录
|
|
9259
|
9259
|
$pv_data = [
|
|
9260
|
9260
|
"uid" => $uid,
|
|
9261
|
|
- "pv" => $num,
|
|
|
9261
|
+ "pv" => $pv,
|
|
9262
|
9262
|
"addtime" => time(),
|
|
9263
|
9263
|
"status" => $status,
|
|
9264
|
9264
|
"order_type" => $order_type,
|
|
9265
|
9265
|
"order_id" => $order_id,
|
|
9266
|
|
- "mark" => str_replace('贡献值', 'PV', $mark),
|
|
|
9266
|
+ "mark" => $mark,
|
|
9267
|
9267
|
];
|
|
|
9268
|
+ // 当状态为1时是实时结算
|
|
|
9269
|
+ if($status == 1) {
|
|
|
9270
|
+ Db::name('user')->where('uid', $uid)->inc('pv', (float)$pv)->update();
|
|
|
9271
|
+ $pv_data['settlement_time'] = date('Y-m-d H:i:s');
|
|
|
9272
|
+ }
|
|
9268
|
9273
|
Db::name("user_pv_log")->insert($pv_data);//添加pv记录
|
|
9269
|
9274
|
}
|
|
9270
|
9275
|
|
|
9271
|
9276
|
//添加贡献值日志
|
|
9272
|
|
- public function con_log($uid, $num, $order_id, $order_type, $mark, $status = -1, $pv = 0)
|
|
|
9277
|
+ public function con_log($uid, $num, $order_id, $order_type, $mark, $status = -1)
|
|
9273
|
9278
|
{
|
|
9274
|
9279
|
|
|
9275
|
9280
|
$con_data = Db::name('user')->where("uid", $uid)->find();
|
|
|
@@ -9289,10 +9294,6 @@ class StoreOrderRepository extends BaseRepository
|
|
9289
|
9294
|
Db::name('user')->where("uid", $uid)->update(['per_contribute' => $con_data['per_contribute'] + $num]);
|
|
9290
|
9295
|
}
|
|
9291
|
9296
|
|
|
9292
|
|
- if($pv > 0){
|
|
9293
|
|
- Db::name('user')->where("uid", $uid)->update(['pv' => $con_data['pv'] + $pv]);
|
|
9294
|
|
- }
|
|
9295
|
|
-
|
|
9296
|
9297
|
//if(count($spread_data) > 0){
|
|
9297
|
9298
|
// $all_ids = [];
|
|
9298
|
9299
|
// foreach($spread_data as $k=>$v){
|
|
|
@@ -9349,7 +9350,6 @@ class StoreOrderRepository extends BaseRepository
|
|
9349
|
9350
|
|
|
9350
|
9351
|
$con = [
|
|
9351
|
9352
|
'uid' => $uid,
|
|
9352
|
|
- 'pv' => $pv,
|
|
9353
|
9353
|
'number' => $num,//赠送数量
|
|
9354
|
9354
|
'status' => $status,//红包状态
|
|
9355
|
9355
|
'mark' => $mark,//备注
|
|
|
@@ -9563,214 +9563,81 @@ class StoreOrderRepository extends BaseRepository
|
|
9563
|
9563
|
$store_product_data = Db::name('store_product')->where('product_id', $store_order_product_data['product_id'])->find();
|
|
9564
|
9564
|
//下单用户
|
|
9565
|
9565
|
$user_data = Db::name('user')->where('uid', $store_order_data['uid'])->find();
|
|
9566
|
|
- //var_dump($user_data['spread_uid']);
|
|
9567
|
9566
|
|
|
9568
|
|
- //$concession_pri = $store_product_data['concession_pri'];//商家让利金额
|
|
|
9567
|
+ //商家让利金额
|
|
9569
|
9568
|
$concession_pri = $store_order_data['con_pri'];
|
|
9570
|
9569
|
|
|
9571
|
9570
|
|
|
9572
|
|
- $spread_uid = 0;//下单用户上级uid
|
|
9573
|
|
- $fgj_pri = 0;//推广者的佣金抽10%到个人复购金
|
|
9574
|
|
-
|
|
9575
|
9571
|
$pv = 0; //待分配的PV
|
|
9576
|
9572
|
|
|
9577
|
|
-
|
|
9578
|
|
- //var_dump($store_product_data['concession_pri']);return;
|
|
9579
|
9573
|
//精彩生活
|
|
9580
|
9574
|
if ($store_order_data['mer_id'] == 439) {
|
|
9581
|
9575
|
//分配参数
|
|
9582
|
|
- $job_par = [];
|
|
9583
|
9576
|
if (!empty($store_order_data)) {
|
|
9584
|
|
- $job_par = json_decode($store_order_data['fzone_paytype'], true);
|
|
9585
|
|
- //if($job_par['note'] == "现金"){
|
|
9586
|
9577
|
//普通消费者
|
|
9587
|
9578
|
$ylj_pri = bcmul($concession_pri, 0.3, 2);
|
|
9588
|
9579
|
$pv = bcmul($concession_pri, 0.35, 2);
|
|
9589
|
9580
|
|
|
9590
|
|
- //分配养老金给消费者
|
|
9591
|
|
- $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
|
|
9592
|
|
- //分配积分和贡献值给消费者
|
|
9593
|
|
- $con = $user_data['contribute'] + $pv;
|
|
9594
|
|
- $score = $user_data['score'] + $pv;
|
|
9595
|
|
-
|
|
9596
|
|
- // Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,"contribute"=>$con,"score"=>$score]);
|
|
9597
|
|
-
|
|
9598
|
9581
|
$this->bill_user_log($user_data['uid'], $ylj_pri, $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . $ylj_pri, $store_order_data['mer_id'], 0);
|
|
9599
|
9582
|
// 贡献值
|
|
9600
|
9583
|
$this->con_log($user_data['uid'], $pv, $store_order_data['order_id'], 11, "购买精彩生活商品赠送贡献值");
|
|
9601
|
|
- $this->con_log_pv($user_data['uid'], $pv, $store_order_data['order_id'], 11, "购买精彩生活商品赠送贡献值");
|
|
|
9584
|
+ $this->con_log_pv($user_data['uid'], $pv, $store_order_data['order_id'], 11, "购买精彩生活商品赠送PV值");
|
|
9602
|
9585
|
// 积分
|
|
9603
|
9586
|
$this->score_log($user_data['uid'], $pv, $store_order_data['order_id'], 11, "购买精彩生活商品赠送积分");
|
|
9604
|
9587
|
|
|
9605
|
|
- //给推广者分配养老金
|
|
9606
|
|
- //给推广者分配佣金
|
|
9607
|
|
- // if ($user_data['spread_uid'] != 0) {
|
|
9608
|
|
- if ($user_data['uid'] > 611) {
|
|
9609
|
|
- //查询下单用户上级身份
|
|
9610
|
|
- $spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
|
9588
|
+ //查询下单用户上级身份
|
|
|
9589
|
+ $spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
9611
|
9590
|
|
|
|
9591
|
+ if (!empty($spread_data)) {
|
|
9612
|
9592
|
//业务员或以上的推荐人等级
|
|
9613
|
9593
|
$rate = static::getUserGroupRate($spread_data['user_group']);
|
|
9614
|
|
- if ($spread_data['user_group'] > 1) {
|
|
9615
|
|
-
|
|
9616
|
|
- // //给推广者分配佣金
|
|
9617
|
|
- $yj_amount = 0;
|
|
9618
|
|
- $ylj_amount = $spread_data['annuity'] + bcmul($pv, 0.05, 2);
|
|
9619
|
|
- $ssf = 0;//变量
|
|
9620
|
|
- $yj_amount_90 = 0;//90%的佣金
|
|
9621
|
|
-
|
|
9622
|
|
- if ($spread_data['user_group'] == 2) {
|
|
9623
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
9624
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9625
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9626
|
|
-
|
|
9627
|
|
-
|
|
9628
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9629
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9630
|
|
-
|
|
9631
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9632
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9633
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9634
|
|
-
|
|
9635
|
|
-
|
|
9636
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9637
|
|
- } else if ($spread_data['user_group'] == 3) {
|
|
9638
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
9639
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9640
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9641
|
|
-
|
|
9642
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9643
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9644
|
|
-
|
|
9645
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9646
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9647
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9648
|
|
-
|
|
9649
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9650
|
|
- } else if ($spread_data['user_group'] == 4) {
|
|
9651
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
9652
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9653
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9654
|
|
-
|
|
9655
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9656
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9657
|
|
-
|
|
9658
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9659
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9660
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9661
|
9594
|
|
|
9662
|
|
- //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9663
|
|
- } else if ($spread_data['user_group'] == 5) {
|
|
9664
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
9665
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9666
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9667
|
|
- // $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
|
|
9668
|
|
-
|
|
9669
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9670
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9671
|
|
-
|
|
9672
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9673
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9674
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9675
|
|
-
|
|
9676
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9677
|
|
- } else if ($spread_data['user_group'] == 6) {
|
|
9678
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
9679
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9680
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9681
|
|
-
|
|
9682
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9683
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9684
|
|
-
|
|
9685
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9686
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9687
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9688
|
|
-
|
|
9689
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9690
|
|
- } else if ($spread_data['user_group'] == 7) {
|
|
9691
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
9692
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9693
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9694
|
|
-
|
|
9695
|
|
-
|
|
9696
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9697
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9698
|
|
-
|
|
9699
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9700
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9701
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9702
|
|
-
|
|
9703
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9704
|
|
- }
|
|
9705
|
|
-
|
|
9706
|
|
- //贡献值
|
|
9707
|
|
- $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "精彩生活区商品赠送贡献值");
|
|
9708
|
|
- //积分
|
|
9709
|
|
- $this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 11, "精彩生活区商品赠送积分");
|
|
9710
|
|
- // //推广佣金
|
|
9711
|
|
- $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);
|
|
9712
|
|
- //养老金
|
|
9713
|
|
- $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);
|
|
9714
|
|
- }
|
|
9715
|
|
-
|
|
9716
|
|
- //普通用户推广人
|
|
9717
|
9595
|
if ($spread_data['user_group'] == 1) {
|
|
9718
|
|
- //给推广者分配佣金
|
|
9719
|
|
-
|
|
9720
|
9596
|
$yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
9721
|
9597
|
$fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9722
|
9598
|
|
|
9723
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9724
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9725
|
9599
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9726
|
9600
|
|
|
9727
|
|
- //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
9728
|
|
-
|
|
9729
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9730
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9731
|
|
-
|
|
9732
|
|
- //贡献值和积分
|
|
9733
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
|
|
9734
|
|
-
|
|
9735
|
9601
|
//推广养老金
|
|
9736
|
9602
|
//推广佣金
|
|
9737
|
9603
|
$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);
|
|
9738
|
9604
|
// 贡献值
|
|
9739
|
|
- $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
|
9605
|
+ $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广精彩生活商品赠送贡献值");
|
|
|
9606
|
+ //积分
|
|
|
9607
|
+ $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广精彩生活商品赠送积分");
|
|
|
9608
|
+ } else if ($spread_data['user_group'] > 1) {
|
|
|
9609
|
+
|
|
|
9610
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9611
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9612
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9613
|
+ $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
|
9614
|
+
|
|
|
9615
|
+ //贡献值
|
|
|
9616
|
+ $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广精彩生活区商品赠送贡献值");
|
|
9740
|
9617
|
//积分
|
|
9741
|
|
- $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分");
|
|
|
9618
|
+ $this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 11, "推广精彩生活区商品赠送积分");
|
|
|
9619
|
+ // //推广佣金
|
|
|
9620
|
+ $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);
|
|
|
9621
|
+ //养老金
|
|
|
9622
|
+ $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);
|
|
9742
|
9623
|
}
|
|
9743
|
9624
|
}
|
|
9744
|
9625
|
|
|
9745
|
9626
|
//锁客收益
|
|
9746
|
9627
|
if ($user_data['mer_id'] != 0) {
|
|
9747
|
|
-
|
|
9748
|
9628
|
$merchant_data = Db::name('merchant')->where('mer_id', $user_data['mer_id'])->find();
|
|
9749
|
|
-
|
|
9750
|
9629
|
$merchant_user_data = Db::name('user')->where('uid', $merchant_data['uid'])->find();
|
|
9751
|
|
-
|
|
9752
|
9630
|
if (!empty($merchant_user_data)) {
|
|
9753
|
|
-
|
|
9754
|
9631
|
//给推广者分配佣金
|
|
9755
|
|
-
|
|
9756
|
9632
|
$yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
|
|
9757
|
9633
|
$fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9758
|
|
-
|
|
9759
|
|
- // $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
|
|
9760
|
|
- // $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
|
|
9761
|
|
- // $this->fugou_user_log($merchant_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
9762
|
|
-
|
|
9763
|
|
-
|
|
9764
|
|
- // Db::name('user')->where('uid',$merchant_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
9765
|
9634
|
//推广佣金
|
|
9766
|
9635
|
$this->bill_user_log($merchant_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);
|
|
9767
|
|
-
|
|
9768
|
9636
|
}
|
|
9769
|
|
-
|
|
9770
|
9637
|
}
|
|
9771
|
9638
|
}
|
|
9772
|
9639
|
|
|
9773
|
|
- //VIP专区
|
|
|
9640
|
+ //VIP专区
|
|
9774
|
9641
|
} else if ($store_order_data['mer_id'] == 496) {
|
|
9775
|
9642
|
|
|
9776
|
9643
|
//业务员和以上推广的等级获得推广佣金
|
|
|
@@ -9805,27 +9672,11 @@ class StoreOrderRepository extends BaseRepository
|
|
9805
|
9672
|
$le_yw_amount = 600;
|
|
9806
|
9673
|
}
|
|
9807
|
9674
|
|
|
9808
|
|
- $ylj_pri = bcmul($pv, 0.035, 2);
|
|
9809
|
|
- //$pv = round($pv * 0.35,2);
|
|
9810
|
|
-
|
|
9811
|
|
- //分配养老金给消费者
|
|
9812
|
|
- //普通用户获取贡献值和pv3.5%养老金和积分
|
|
9813
|
|
- $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
|
|
9814
|
|
- $gxz_amount_mine = $user_data['contribute'] + $gx_jf;
|
|
9815
|
|
- $jf_amount_mine = $user_data['score'] + $gx_jf;
|
|
9816
|
|
-
|
|
9817
|
|
-
|
|
9818
|
|
- // Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
|
|
9819
|
|
-
|
|
9820
|
9675
|
$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']);
|
|
9821
|
|
- $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1, $gx_jf);
|
|
9822
|
|
- // $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']);
|
|
9823
|
|
- $this->con_log_pv($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1);
|
|
9824
|
|
- // $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1);
|
|
|
9676
|
+ $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值",1);
|
|
|
9677
|
+ $this->con_log_pv($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送PV值", 1);
|
|
9825
|
9678
|
$this->score_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送积分", 1);
|
|
9826
|
9679
|
|
|
9827
|
|
- //查询下单用户上级身份(2.0新表用户)
|
|
9828
|
|
- $spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
9829
|
9680
|
//查询下单用户上级身份(1.0表用户,会员升级)
|
|
9830
|
9681
|
$spread_data_old = 0;
|
|
9831
|
9682
|
if ($user_data['spread_old'] != 0) {
|
|
|
@@ -9833,161 +9684,53 @@ class StoreOrderRepository extends BaseRepository
|
|
9833
|
9684
|
if (!empty($sf)) {
|
|
9834
|
9685
|
$spread_data_old = $sf;
|
|
9835
|
9686
|
}
|
|
9836
|
|
-
|
|
9837
|
9687
|
}
|
|
9838
|
9688
|
|
|
9839
|
|
- //给推广者分配养老金
|
|
9840
|
|
- //给推广者分配佣金
|
|
9841
|
|
- // if ($user_data['spread_uid'] != 0) {
|
|
9842
|
|
- // if ($user_data['uid'] > 611) {
|
|
9843
|
|
-
|
|
9844
|
|
-
|
|
9845
|
|
- //查询下单用户上级身份
|
|
9846
|
|
- $spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
9847
|
|
-
|
|
9848
|
|
- //业务员或以上的推荐人等级
|
|
9849
|
|
- $rate = static::getUserGroupRate($spread_data['user_group']);
|
|
9850
|
|
-
|
|
9851
|
|
- //user_group=1是消费者,2:业务,3:业务经理,4:初级合伙人,5:中级合伙人,6:高级合伙人,7:董事
|
|
9852
|
|
- //业务或以上等级推广人
|
|
9853
|
|
- //获得养老金、佣金、贡献值和积分
|
|
9854
|
|
- if ($spread_data['user_group'] > 1) {
|
|
9855
|
|
-
|
|
9856
|
|
-
|
|
9857
|
|
- $con = 0;//贡献值
|
|
9858
|
|
- $score = 0;//积分
|
|
9859
|
|
- //养老金
|
|
9860
|
|
- $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035, 2);
|
|
9861
|
|
- //$yongjin = $spread_data['brokerage_price'] + $le_yw_amount;
|
|
9862
|
|
-
|
|
9863
|
|
- $yj_amount_90 = $le_yw_amount * 0.9;
|
|
9864
|
|
- $fgj_amount_10 = $le_yw_amount * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9865
|
|
-
|
|
9866
|
|
- $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9867
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9868
|
|
-
|
|
9869
|
|
- $this->score_log($spread_data['uid'], bcmul($gx_jf, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9870
|
|
-
|
|
9871
|
|
- // if ($spread_data['user_group'] == 2) {
|
|
9872
|
|
-
|
|
9873
|
|
- // $con = $spread_data['contribute'] + bcmul($pv, 0.07, 2);
|
|
9874
|
|
- // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.07, 2);
|
|
9875
|
|
- // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9876
|
|
-
|
|
9877
|
|
- // //贡献值
|
|
9878
|
|
- // // $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9879
|
|
- // //积分
|
|
9880
|
|
- // $this->score_log($spread_data['uid'], bcmul($pv, 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9881
|
|
-
|
|
9882
|
|
- // } else if ($spread_data['user_group'] == 3) {
|
|
9883
|
|
-
|
|
9884
|
|
-
|
|
9885
|
|
- // $con = $spread_data['contribute'] + bcmul($pv, 0.09, 2);
|
|
9886
|
|
- // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.09, 2);
|
|
9887
|
|
- // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9888
|
|
-
|
|
9889
|
|
- // //贡献值
|
|
9890
|
|
- // // $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9891
|
|
- // //积分
|
|
9892
|
|
- // $this->score_log($spread_data['uid'], bcmul($pv, 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9893
|
|
-
|
|
9894
|
|
-
|
|
9895
|
|
- // } else if ($spread_data['user_group'] == 4) {
|
|
9896
|
|
- // $con = $spread_data['contribute'] + bcmul($pv, 0.11, 2);
|
|
9897
|
|
- // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.11, 2);
|
|
9898
|
|
- // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9899
|
|
-
|
|
9900
|
|
- // //贡献值
|
|
9901
|
|
- // //$this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9902
|
|
- // //积分
|
|
9903
|
|
- // $this->score_log($spread_data['uid'], bcmul($pv, 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9904
|
|
-
|
|
9905
|
|
-
|
|
9906
|
|
- // } else if ($spread_data['user_group'] == 5) {
|
|
9907
|
|
- // $con = $spread_data['contribute'] + bcmul($pv, 0.13, 2);
|
|
9908
|
|
- // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.13, 2);
|
|
9909
|
|
- // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9910
|
|
-
|
|
9911
|
|
- // //贡献值
|
|
9912
|
|
- // // $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9913
|
|
- // //积分
|
|
9914
|
|
- // $this->score_log($spread_data['uid'], bcmul($pv, 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9915
|
|
-
|
|
9916
|
|
- // } else if ($spread_data['user_group'] == 6) {
|
|
9917
|
|
- // $con = $spread_data['contribute'] + bcmul($pv, 0.15, 2);
|
|
9918
|
|
- // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.15, 2);
|
|
9919
|
|
- // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9920
|
|
-
|
|
9921
|
|
- // //贡献值
|
|
9922
|
|
- // // $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9923
|
|
- // //积分
|
|
9924
|
|
- // $this->score_log($spread_data['uid'], bcmul($pv, 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9925
|
|
-
|
|
9926
|
|
-
|
|
9927
|
|
- // } else if ($spread_data['user_group'] == 7) {
|
|
9928
|
|
- // $con = $spread_data['contribute'] + bcmul($pv, 0.17, 2);
|
|
9929
|
|
- // $score = $spread_data['brokerage_price'] + bcmul($pv, 0.17, 2);
|
|
9930
|
|
- // // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9931
|
|
-
|
|
9932
|
|
- // //贡献值
|
|
9933
|
|
- // //$this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9934
|
|
- // //积分
|
|
9935
|
|
- // $this->score_log($spread_data['uid'], bcmul($pv, 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9936
|
|
-
|
|
9937
|
|
-
|
|
9938
|
|
- // }
|
|
9939
|
|
- Db::name('test_log')->insert(['note' => "走到这里4"]);//测试
|
|
9940
|
|
- //贡献值
|
|
9941
|
|
- $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, round($gx_jf, 2));
|
|
9942
|
|
-
|
|
9943
|
|
- //养老金
|
|
9944
|
|
- $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']);
|
|
9945
|
|
- //佣金
|
|
9946
|
|
- $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']);
|
|
9947
|
|
- //复购金
|
|
9948
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
9949
|
|
- }
|
|
9950
|
|
-
|
|
9951
|
|
- //普通的用户推广人
|
|
9952
|
|
- if ($spread_data['user_group'] == 1) {
|
|
9953
|
|
-
|
|
9954
|
|
- //获取贡献值和积分和佣金
|
|
9955
|
|
- // $gx_jf = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
9956
|
|
-
|
|
|
9689
|
+ //查询下单用户上级身份
|
|
|
9690
|
+ $spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
9957
|
9691
|
|
|
9958
|
|
- $yj_amount_90 = bcmul($yj1, 0.9, 2);
|
|
9959
|
|
- $fgj_amount_10 = bcmul($yj1, 0.1, 2);//推广者的佣金抽10%到个人复购金
|
|
|
9692
|
+ //业务员或以上的推荐人等级
|
|
|
9693
|
+ $rate = static::getUserGroupRate($spread_data['user_group']);
|
|
9960
|
9694
|
|
|
9961
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9962
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9963
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
|
9695
|
+ //user_group=1是消费者,2:业务,3:业务经理,4:初级合伙人,5:中级合伙人,6:高级合伙人,7:董事
|
|
|
9696
|
+ //业务或以上等级推广人
|
|
|
9697
|
+ //获得养老金、佣金、贡献值和积分
|
|
|
9698
|
+ if ($spread_data['user_group'] > 1) {
|
|
9964
|
9699
|
|
|
|
9700
|
+ $yj_amount_90 = $le_yw_amount * 0.9;
|
|
|
9701
|
+ $fgj_amount_10 = $le_yw_amount * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9965
|
9702
|
|
|
9966
|
|
- //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $gx_jf,'score'=> $gx_jf,'brokerage_price'=> $yj_amount,'fugou'=>$fgj_amount]);
|
|
9967
|
|
- $this->con_log($spread_data['uid'], bcmul($gx_jf, 0.3, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, bcmul($gx_jf, 0.3, 2));
|
|
9968
|
|
- $this->score_log($spread_data['uid'], bcmul($gx_jf, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9969
|
|
- //推广佣金
|
|
9970
|
|
- $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']);
|
|
9971
|
|
- }
|
|
|
9703
|
+ $this->score_log($spread_data['uid'], bcmul($gx_jf, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9704
|
+ //贡献值
|
|
|
9705
|
+ $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
|
|
9972
|
9706
|
|
|
|
9707
|
+ //养老金
|
|
|
9708
|
+ $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']);
|
|
|
9709
|
+ //佣金
|
|
|
9710
|
+ $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']);
|
|
|
9711
|
+ //复购金
|
|
|
9712
|
+ $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
|
9713
|
+ }
|
|
9973
|
9714
|
|
|
9974
|
|
- // } else if ($spread_data_old != 0) {
|
|
9975
|
|
- if ($spread_data_old != 0) {
|
|
|
9715
|
+ //普通的用户推广人
|
|
|
9716
|
+ if ($spread_data['user_group'] == 1) {
|
|
|
9717
|
+ $yj_amount_90 = bcmul($yj1, 0.9, 2);
|
|
|
9718
|
+ $fgj_amount_10 = bcmul($yj1, 0.1, 2);//推广者的佣金抽10%到个人复购金
|
|
|
9719
|
+ $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
|
9720
|
+ $this->con_log($spread_data['uid'], bcmul($gx_jf, 0.3, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
|
|
|
9721
|
+ $this->score_log($spread_data['uid'], bcmul($gx_jf, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9722
|
+ //推广佣金
|
|
|
9723
|
+ $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']);
|
|
|
9724
|
+ }
|
|
9976
|
9725
|
|
|
|
9726
|
+ if ($spread_data_old != 0) {
|
|
9977
|
9727
|
//1.0jbp系统中,如果有用户升级会员,给推荐人贡献值(90%)和养老金(10%)
|
|
9978
|
9728
|
$spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
|
|
9979
|
|
- //$spread_data = Db::name('user')->where('uid',473)->find();
|
|
9980
|
|
- //养老金
|
|
9981
|
|
- $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035, 2);
|
|
9982
|
|
-
|
|
9983
|
9729
|
|
|
9984
|
9730
|
$yj_amount_90 = $le_yw_amount * 0.9;
|
|
9985
|
9731
|
$fgj_amount_10 = $le_yw_amount * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9986
|
9732
|
|
|
9987
|
|
- $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9988
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9989
|
|
-
|
|
9990
|
|
- $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, round($gx_jf, 2));
|
|
|
9733
|
+ $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
|
|
9991
|
9734
|
//养老金
|
|
9992
|
9735
|
$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']);
|
|
9993
|
9736
|
//佣金
|
|
|
@@ -9995,90 +9738,30 @@ class StoreOrderRepository extends BaseRepository
|
|
9995
|
9738
|
//复购金
|
|
9996
|
9739
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
9997
|
9740
|
|
|
9998
|
|
- // $bill = [
|
|
9999
|
|
- // 'uid'=>$spread_data['uid'],
|
|
10000
|
|
- // 'number'=>$fgj_amount_10,//数量
|
|
10001
|
|
- // 'status'=>1,//复购金状态1-有效 0-失效 -1待确认
|
|
10002
|
|
- // 'mark'=>"复购金",//备注
|
|
10003
|
|
- // // 'desc'=>"抽取佣金的10%作为复购金",//描述
|
|
10004
|
|
- // 'order_id'=>$store_order_data['order_id'],//订单id
|
|
10005
|
|
- // 'surplus'=>0,//剩余
|
|
10006
|
|
- // 'order_type'=>11,//关联订单ID
|
|
10007
|
|
- // 'type'=>1,//复购金类型 :1赠送,2消耗
|
|
10008
|
|
- // 'settlement_time'=>date('Y-m-d H:i:s'),//添加时间,
|
|
10009
|
|
- // 'addtime'=>time(),
|
|
10010
|
|
- // ];
|
|
10011
|
|
-
|
|
10012
|
|
- // $poi = Db::name('user_sign_fugou')->insert($bill);
|
|
10013
|
|
-
|
|
10014
|
|
- // Db::name("test_log")->insert(["note"=>$spread_data['uid'] . " value:" .$fgj_amount_10 . " order:".$store_order_data['order_id']."dd:" .json_encode($bill)]);
|
|
10015
|
|
-
|
|
10016
|
9741
|
$orderInfo = [
|
|
10017
|
9742
|
'num' => 1,
|
|
10018
|
9743
|
'gb_num' => 1,
|
|
10019
|
9744
|
'price' => $store_product_data['price']
|
|
10020
|
9745
|
];
|
|
10021
|
|
-
|
|
10022
|
9746
|
$goods_of_info1 = Db::name("old_user_of_goods")->where("id", $store_order_data['user_of_goods_id'])->find();//用户的订单价格表
|
|
10023
|
9747
|
if (!empty($goods_of_info1)) {
|
|
10024
|
9748
|
$this->member_update($orderInfo, $goods_of_info1, $user_data['uid']);
|
|
10025
|
9749
|
}
|
|
10026
|
|
-
|
|
10027
|
|
-
|
|
10028
|
9750
|
}
|
|
10029
|
9751
|
|
|
10030
|
|
- // public function fugou_user_log($uid,$num,$order_id,$type_inc_des,$status=-1){
|
|
10031
|
|
-
|
|
10032
|
|
- // $fugou_data = Db::name('user')->where("uid",$uid)->find();
|
|
10033
|
|
- // //如果状态是1那就是即刻入账,
|
|
10034
|
|
- // if($status == 1){
|
|
10035
|
|
- // $con_data_fugoujin = Db::name('user')->where("uid",$uid)->update(['fugou'=>$fugou_data['fugou'] + $num]);
|
|
10036
|
|
- // }
|
|
10037
|
|
-
|
|
10038
|
|
- // $bill = [
|
|
10039
|
|
- // 'uid'=>$uid,
|
|
10040
|
|
- // 'number'=>$num,//数量
|
|
10041
|
|
- // 'status'=>$status,//复购金状态1-有效 0-失效 -1待确认
|
|
10042
|
|
- // 'mark'=>"复购金",//备注
|
|
10043
|
|
- // 'desc'=>"抽取佣金的10%作为复购金",//描述
|
|
10044
|
|
- // 'order_id'=>$order_id,//订单id
|
|
10045
|
|
- // 'surplus'=>0,//剩余
|
|
10046
|
|
- // 'order_type'=>11,//关联订单ID
|
|
10047
|
|
- // 'type'=>$type_inc_des,//复购金类型 :1赠送,2消耗
|
|
10048
|
|
- // 'settlement_time'=>date('Y-m-d H:i:s'),//添加时间,
|
|
10049
|
|
- // 'addtime'=>time(),
|
|
10050
|
|
- // ];
|
|
10051
|
|
-
|
|
10052
|
|
- // Db::name('user_sign_fugou')->insert($bill);
|
|
10053
|
|
- // }
|
|
10054
|
|
-
|
|
10055
|
|
-
|
|
10056
|
9752
|
//锁客收益
|
|
10057
|
9753
|
if ($user_data['mer_id'] != 0) {
|
|
10058
|
|
-
|
|
10059
|
9754
|
$merchant_data = Db::name('merchant')->where('mer_id', $user_data['mer_id'])->find();
|
|
10060
|
|
-
|
|
10061
|
9755
|
$merchant_user_data = Db::name('user')->where('uid', $merchant_data['uid'])->find();
|
|
10062
|
|
-
|
|
10063
|
9756
|
if (!empty($merchant_data) && !empty($merchant_user_data)) {
|
|
10064
|
|
-
|
|
10065
|
|
-
|
|
10066
|
9757
|
$yj_amount_90 = bcmul($pv , 0.035, 2) * 0.9;
|
|
10067
|
9758
|
$fgj_amount_10 = bcmul($pv, 0.035, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10068
|
|
-
|
|
10069
|
|
- $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
|
|
10070
|
|
- $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
|
|
10071
|
9759
|
$this->fugou_user_log($merchant_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
10072
|
|
-
|
|
10073
|
|
-
|
|
10074
|
|
- // Db::name('user')->where('uid',$merchant_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
10075
|
9760
|
//推广佣金
|
|
10076
|
9761
|
$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']);
|
|
10077
|
9762
|
}
|
|
10078
|
|
-
|
|
10079
|
9763
|
}
|
|
10080
|
9764
|
|
|
10081
|
|
-
|
|
10082
|
9765
|
//会员专区,给用户升级判断
|
|
10083
|
9766
|
$orderList = Db::name("store_order")->where("uid", $store_order_data['uid'])->where("mer_id", 496)->where("status", "in", [0, 1, 2, 3])->select();
|
|
10084
|
9767
|
// 初始化总和变量
|
|
|
@@ -10093,14 +9776,12 @@ class StoreOrderRepository extends BaseRepository
|
|
10093
|
9776
|
$userdata = Db::name("user")->where("uid", $store_order_data['uid'])->find();
|
|
10094
|
9777
|
|
|
10095
|
9778
|
if ($totalPayPrice >= 1180 && $totalPayPrice < 11800) {
|
|
10096
|
|
-
|
|
10097
|
9779
|
if ($userdata['user_group'] <= 1) {
|
|
10098
|
9780
|
// Db::name("user")->where("uid", $store_order_data['uid'])->update(["user_group" => 2]);
|
|
10099
|
9781
|
/** @var UserRepository $userRepository */
|
|
10100
|
9782
|
$userRepository = app()->make(UserRepository::class);
|
|
10101
|
9783
|
$userRepository->setUserIdentity($store_order_data['uid']);
|
|
10102
|
9784
|
}
|
|
10103
|
|
-
|
|
10104
|
9785
|
} else if ($totalPayPrice >= 11800) {
|
|
10105
|
9786
|
if ($userdata['user_group'] <= 2) {
|
|
10106
|
9787
|
// Db::name("user")->where("uid", $store_order_data['uid'])->update(["user_group" => 3]);
|
|
|
@@ -10110,7 +9791,6 @@ class StoreOrderRepository extends BaseRepository
|
|
10110
|
9791
|
}
|
|
10111
|
9792
|
}
|
|
10112
|
9793
|
|
|
10113
|
|
-
|
|
10114
|
9794
|
} else {
|
|
10115
|
9795
|
// 商贸区
|
|
10116
|
9796
|
/** @var \app\common\repositories\merchant\MerchantRepository $merchant */
|
|
|
@@ -10122,115 +9802,30 @@ class StoreOrderRepository extends BaseRepository
|
|
10122
|
9802
|
$ylj_pri = bcmul($concession_pri, 0.3, 2); // 让利部分30%给消费者做养老金
|
|
10123
|
9803
|
$pv = bcmul($concession_pri, 0.35, 2); // 35%做业绩PV分配
|
|
10124
|
9804
|
|
|
10125
|
|
- //分配养老金给消费者
|
|
10126
|
|
- $ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
|
|
10127
|
|
- //分配积分和贡献值给消费者
|
|
10128
|
|
- $con = $user_data['contribute'] + $pv;
|
|
10129
|
|
- $score = $user_data['score'] + $pv;
|
|
10130
|
|
-
|
|
10131
|
9805
|
// 让利部分30%给消费者做养老金{$ylj_pri}
|
|
10132
|
9806
|
$this->bill_user_log($user_data['uid'], $ylj_pri, $store_order_data['order_id'], 5, $group_order['group_order_sn'], '购买商贸区商品获得养老金' . $ylj_pri, $store_order_data['mer_id'], 0);
|
|
10133
|
|
- // @todo 消费者购买商品赠送PV等值的积分和贡献值
|
|
10134
|
|
- // 贡献值
|
|
10135
|
|
-// $this->con_log($user_data['uid'], $pv, $store_order_data['order_id'], 12, "购买商贸区商品赠送贡献值");
|
|
|
9807
|
+ // 购买商贸区赠送贡献值
|
|
|
9808
|
+ $this->con_log($user_data['uid'], $pv, $store_order_data['order_id'], 12, "购买商贸区商品赠送贡献值");
|
|
|
9809
|
+ // 购买商贸区赠送PV值
|
|
|
9810
|
+ $this->con_log_pv($user_data['uid'], $pv, $store_order_data['order_id'], 12, "购买商贸区赠送PV值");
|
|
10136
|
9811
|
// 积分
|
|
10137
|
9812
|
$this->score_log($user_data['uid'], $pv, $store_order_data['order_id'], 12, "购买商贸区商品赠送积分");
|
|
10138
|
9813
|
|
|
10139
|
|
- // @todo ------------PV业绩100%分配如下------------------
|
|
10140
|
9814
|
if ($user_data['spread_uid'] != 0) {
|
|
10141
|
9815
|
//查询下单用户上级
|
|
10142
|
9816
|
$spread_data = Db::name('user')->where('uid', $user_data['spread_uid'])->find();
|
|
10143
|
9817
|
|
|
10144
|
9818
|
$rate = static::getUserGroupRate($spread_data['user_group']);
|
|
10145
|
9819
|
if ($spread_data['user_group'] > 1) {
|
|
10146
|
|
- $ssf = 0;//变量
|
|
10147
|
|
- $yj_amount_90 = 0;//90%的佣金
|
|
10148
|
|
- // 业务员
|
|
10149
|
|
- if ($spread_data['user_group'] == 2) {
|
|
10150
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
10151
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10152
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10153
|
|
-
|
|
10154
|
|
-
|
|
10155
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10156
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10157
|
|
-
|
|
10158
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10159
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10160
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10161
|
|
- } else if ($spread_data['user_group'] == 3) {
|
|
10162
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
10163
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10164
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10165
|
|
-
|
|
10166
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10167
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10168
|
|
-
|
|
10169
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10170
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10171
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10172
|
|
-
|
|
10173
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10174
|
|
- } else if ($spread_data['user_group'] == 4) {
|
|
10175
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
10176
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10177
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10178
|
|
-
|
|
10179
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10180
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10181
|
|
-
|
|
10182
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10183
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10184
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10185
|
|
-
|
|
10186
|
|
- //Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10187
|
|
- } else if ($spread_data['user_group'] == 5) {
|
|
10188
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
10189
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10190
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10191
|
|
- // $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
|
|
10192
|
|
-
|
|
10193
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10194
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10195
|
|
-
|
|
10196
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10197
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10198
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10199
|
|
-
|
|
10200
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10201
|
|
- } else if ($spread_data['user_group'] == 6) {
|
|
10202
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
10203
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10204
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10205
|
|
-
|
|
10206
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10207
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10208
|
|
-
|
|
10209
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10210
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10211
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10212
|
|
-
|
|
10213
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10214
|
|
- } else if ($spread_data['user_group'] == 7) {
|
|
10215
|
|
- $ssf = bcmul($pv, $rate, 2);
|
|
10216
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10217
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10218
|
|
-
|
|
10219
|
|
-
|
|
10220
|
|
- $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10221
|
|
- $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10222
|
|
-
|
|
10223
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10224
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10225
|
|
- $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10226
|
|
-
|
|
10227
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10228
|
|
- }
|
|
|
9820
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9821
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9822
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9823
|
+ $this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10229
|
9824
|
|
|
10230
|
9825
|
//贡献值
|
|
10231
|
|
- $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "商贸区商品赠送贡献值");
|
|
|
9826
|
+ $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "推广商贸区商品赠送贡献值");
|
|
10232
|
9827
|
//积分
|
|
10233
|
|
- $this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 12, "商贸区商品赠送积分");
|
|
|
9828
|
+ $this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
|
|
10234
|
9829
|
//推广佣金
|
|
10235
|
9830
|
$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);
|
|
10236
|
9831
|
//养老金
|
|
|
@@ -10244,18 +9839,8 @@ class StoreOrderRepository extends BaseRepository
|
|
10244
|
9839
|
$yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
10245
|
9840
|
$fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10246
|
9841
|
|
|
10247
|
|
- $yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10248
|
|
- $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10249
|
9842
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10250
|
9843
|
|
|
10251
|
|
- //Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
10252
|
|
-
|
|
10253
|
|
- $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
10254
|
|
- $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10255
|
|
-
|
|
10256
|
|
- //贡献值和积分
|
|
10257
|
|
- // Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
|
|
10258
|
|
-
|
|
10259
|
9844
|
//推广佣金
|
|
10260
|
9845
|
$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);
|
|
10261
|
9846
|
// 贡献值
|
|
|
@@ -10273,11 +9858,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10273
|
9858
|
//给推广者分配佣金
|
|
10274
|
9859
|
$yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
|
|
10275
|
9860
|
$fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10276
|
|
-
|
|
10277
|
|
- $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
|
|
10278
|
|
- $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
|
|
10279
|
9861
|
$this->fugou_user_log($merchant_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10280
|
|
-
|
|
10281
|
9862
|
//推广佣金
|
|
10282
|
9863
|
$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);
|
|
10283
|
9864
|
}
|
|
|
@@ -10285,27 +9866,27 @@ class StoreOrderRepository extends BaseRepository
|
|
10285
|
9866
|
$orderMerchantRepository = app()->make(OrderMerchantRepository::class);
|
|
10286
|
9867
|
$jdAndGonxianConfig = $orderMerchantRepository->getMerchantContribution($store_order_data['extension_two']);
|
|
10287
|
9868
|
|
|
10288
|
|
- //商户获得贡献值
|
|
10289
|
|
- if ($concession_pri >= 0.01) {
|
|
10290
|
|
- $gonxian = bcmul($concession_pri, $jdAndGonxianConfig['gonxian'], 2);
|
|
10291
|
|
- $gongxian_data = [
|
|
10292
|
|
- "uid" => $merchant_data["uid"],
|
|
10293
|
|
- "mer_id" => $user_data['mer_id'],
|
|
10294
|
|
- "pv" => $pv,
|
|
10295
|
|
- "number" => $gonxian,
|
|
10296
|
|
- "addtime" => time(),
|
|
10297
|
|
- "status" => -1,
|
|
10298
|
|
- "order_type" => 2,
|
|
10299
|
|
- "order_id" => $store_order_data['order_id'],
|
|
10300
|
|
- "mark" => "锁客商家获得贡献值",
|
|
10301
|
|
- "desc" => '',
|
|
10302
|
|
- "surplus" => $gonxian,
|
|
10303
|
|
- "type" => 1
|
|
10304
|
|
- ];
|
|
10305
|
|
- Db::name("user_sign_gongxian")->insert($gongxian_data);//添加记录
|
|
10306
|
|
- } else {
|
|
10307
|
|
- Db::name('log')->insert(['data' => '订单号:' . $store_order_data['order_id'] . '付款额度较低或 商家、平台设置的返佣比例较低,贡献值低于0.01无法入库 特此记录!']);
|
|
10308
|
|
- }
|
|
|
9869
|
+ //商户获得贡献值 ---- 3月29日 商户不再获得贡献值 改为获得分润值
|
|
|
9870
|
+// if ($concession_pri >= 0.01) {
|
|
|
9871
|
+// $gonxian = bcmul($concession_pri, $jdAndGonxianConfig['gonxian'], 2);
|
|
|
9872
|
+// $gongxian_data = [
|
|
|
9873
|
+// "uid" => $merchant_data["uid"],
|
|
|
9874
|
+// "mer_id" => $user_data['mer_id'],
|
|
|
9875
|
+// "pv" => $pv,
|
|
|
9876
|
+// "number" => $gonxian,
|
|
|
9877
|
+// "addtime" => time(),
|
|
|
9878
|
+// "status" => -1,
|
|
|
9879
|
+// "order_type" => 2,
|
|
|
9880
|
+// "order_id" => $store_order_data['order_id'],
|
|
|
9881
|
+// "mark" => "锁客商家获得贡献值",
|
|
|
9882
|
+// "desc" => '',
|
|
|
9883
|
+// "surplus" => $gonxian,
|
|
|
9884
|
+// "type" => 1
|
|
|
9885
|
+// ];
|
|
|
9886
|
+// Db::name("user_sign_gongxian")->insert($gongxian_data);//添加记录
|
|
|
9887
|
+// } else {
|
|
|
9888
|
+// Db::name('log')->insert(['data' => '订单号:' . $store_order_data['order_id'] . '付款额度较低或 商家、平台设置的返佣比例较低,贡献值低于0.01无法入库 特此记录!']);
|
|
|
9889
|
+// }
|
|
10309
|
9890
|
|
|
10310
|
9891
|
//商户获得京豆
|
|
10311
|
9892
|
if ($concession_pri >= 0.01) {
|
|
|
@@ -10340,27 +9921,16 @@ class StoreOrderRepository extends BaseRepository
|
|
10340
|
9921
|
|
|
10341
|
9922
|
//当前用户在1.0中没有注册,但是父级在1.0系统中注册过。
|
|
10342
|
9923
|
if (!empty($sf)) {
|
|
10343
|
|
-
|
|
10344
|
9924
|
//检查用户在旧表中是否与上级,有的话就是升级权限,要新增一个user_of_goods的表
|
|
10345
|
9925
|
if ($store_order_data['user_of_goods_id'] != 1) {
|
|
10346
|
|
-
|
|
10347
|
9926
|
$data1['id'] = $store_order_data['user_of_goods_id'];
|
|
10348
|
9927
|
$data1['status'] = 1;
|
|
10349
|
|
-
|
|
10350
|
|
-
|
|
10351
|
9928
|
$data1['create_time'] = time();
|
|
10352
|
|
-
|
|
10353
|
|
- //return app('json')->fail("333");
|
|
10354
|
|
-
|
|
10355
|
9929
|
$sfe = Db::name('old_user_of_goods')->update($data1);
|
|
10356
|
9930
|
}
|
|
10357
|
|
-
|
|
10358
|
|
-
|
|
10359
|
9931
|
}
|
|
10360
|
9932
|
|
|
10361
|
9933
|
//1.0老用户在新2.0表中升级 end
|
|
10362
|
|
-
|
|
10363
|
|
-
|
|
10364
|
9934
|
}
|
|
10365
|
9935
|
|
|
10366
|
9936
|
/**
|