Pārlūkot izejas kodu

修改下单养老金问题

chengzhiyixia 1 gadu atpakaļ
vecāks
revīzija
ffa710f2f2

+ 36 - 7
app/common/repositories/store/order/StoreOrderRepository.php

@@ -9154,22 +9154,51 @@ class StoreOrderRepository extends BaseRepository
9154
     }
9154
     }
9155
 
9155
 
9156
     //添加推广佣金/养老金日志(养老金金额)
9156
     //添加推广佣金/养老金日志(养老金金额)
9157
-    public function bill_user_log($uid,$num,$order_id,$comm_order_type,$order_sn,$mark,$merid,$ds=1){
9157
+    public function bill_user_log($uid,$num,$order_id,$comm_order_type,$order_sn,$mark,$merid,$ds=0){
9158
 
9158
 
9159
         $con_data = Db::name('user')->where("uid",$uid)->find();
9159
         $con_data = Db::name('user')->where("uid",$uid)->find();
9160
         //如果是会员专区就即刻到账
9160
         //如果是会员专区就即刻到账
9161
         $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->find();
9161
         $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->find();
9162
-        if($order_from_mer['mer_id'] == 496 && $comm_order_type==3){
9163
-            // Db::name('user')->where("order_id",$order_id)->find();
9164
-            Db::name('user')->where("uid",$con_data['uid'])->update(['brokerage_price'=> $con_data['brokerage_price'] + $num]);
9162
+
9163
+        $sm_status = 0;//储存当前用户是否有实名的状态
9164
+
9165
+        if($order_from_mer['mer_id'] == 496){
9166
+        
9167
+            //如果是会员区的直推就即刻到账
9168
+            if($comm_order_type == 3){
9169
+                Db::name('user')->where("uid",$con_data['uid'])->update(['brokerage_price'=> $con_data['brokerage_price'] + $num]);
9170
+            }
9171
+            //如果是会员区的养老金,查看是否有实名,如果实名就改变订单状态和user-bill的状态
9172
+            if($comm_order_type == 5){
9173
+
9174
+                //当前用户是否有实名,然后改变user_bill和order_store的gzc状态
9175
+                $get_cer_datas = Db::name('user_certification')->where("uid",$uid)->find();
9176
+                if(!empty($get_cer_datas)){
9177
+                    if(!empty($get_cer_datas['user_card'])){
9178
+
9179
+                        $sm_status = 1;
9180
+                        $ds = 1;
9181
+                        $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>1]);
9182
+                       
9183
+                    }else{
9184
+                        $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>0]);
9185
+                    }
9186
+                }
9187
+
9188
+                
9189
+            }
9190
+           
9165
         }
9191
         }
9166
 
9192
 
9167
 
9193
 
9168
         $name = '';
9194
         $name = '';
9195
+       
9169
         if($comm_order_type==3){
9196
         if($comm_order_type==3){
9170
             $name = '直推奖';
9197
             $name = '直推奖';
9198
+            $ds = 1;
9171
         }else if($comm_order_type==5){
9199
         }else if($comm_order_type==5){
9172
             $name = '养老金';
9200
             $name = '养老金';
9201
+            //$user_bill_status = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>1]);
9173
         }
9202
         }
9174
 
9203
 
9175
         $bill = [
9204
         $bill = [
@@ -9183,7 +9212,7 @@ class StoreOrderRepository extends BaseRepository
9183
             'balance'=>0,//剩余
9212
             'balance'=>0,//剩余
9184
             'mark'=>$mark,//备注
9213
             'mark'=>$mark,//备注
9185
             'create_time'=>date('Y-m-d H:i:s'),//添加时间
9214
             'create_time'=>date('Y-m-d H:i:s'),//添加时间
9186
-            'status'=>$ds,//0待确定,1有效,-1无效
9215
+            'status'=> $ds,//0待确定,1有效,-1无效
9187
             'commission_type'=>$comm_order_type,//佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\r\n5 养老金√ 6 广告费
9216
             'commission_type'=>$comm_order_type,//佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\r\n5 养老金√ 6 广告费
9188
             //7 跨店奖励√ 8平台奖励 9渠道商\r\n10 推荐创客收益√ 11分红奖金√ 12代理区域收益√ 13消费循环佣金
9217
             //7 跨店奖励√ 8平台奖励 9渠道商\r\n10 推荐创客收益√ 11分红奖金√ 12代理区域收益√ 13消费循环佣金
9189
             //14-推荐代理收益√ 15邀请小区团长升级√ 16大v分享奖√ 17创客合伙人√ 18积分奖励√ 19创客补贴√’
9218
             //14-推荐代理收益√ 15邀请小区团长升级√ 16大v分享奖√ 17创客合伙人√ 18积分奖励√ 19创客补贴√’
@@ -9194,13 +9223,12 @@ class StoreOrderRepository extends BaseRepository
9194
             'source'=>0,//1线下 0线上
9223
             'source'=>0,//1线下 0线上
9195
             'order_type'=>1,//1自营  2 第三方  订单类型
9224
             'order_type'=>1,//1自营  2 第三方  订单类型
9196
             'is_red_brokerage'=>0,//1红积分对冲佣金 0正常佣金
9225
             'is_red_brokerage'=>0,//1红积分对冲佣金 0正常佣金
9197
-            'gzc'=>3,//养老金是否已进入公证处log表0:未进入。1:已进入
9226
+            'gzc'=> $sm_status,//养老金是否已进入公证处log表0:未进入。1:已进入
9198
             'take_time'=>'',//结算时间
9227
             'take_time'=>'',//结算时间
9199
             'district_id'=>'',//
9228
             'district_id'=>'',//
9200
             'street_id'=>'',//
9229
             'street_id'=>'',//
9201
             'month'=>'',//月份
9230
             'month'=>'',//月份
9202
 
9231
 
9203
-
9204
         ];
9232
         ];
9205
 
9233
 
9206
         Db::name('user_bill')->insert($bill);
9234
         Db::name('user_bill')->insert($bill);
@@ -9679,6 +9707,7 @@ class StoreOrderRepository extends BaseRepository
9679
                 $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
9707
                 $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
9680
                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9708
                 $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
9681
 
9709
 
9710
+                $this->con_log($spread_data['uid'],round($gx_jf,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
9682
                 //养老金
9711
                 //养老金
9683
                 $this->bill_user_log($spread_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
9712
                 $this->bill_user_log($spread_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
9684
                 //佣金
9713
                 //佣金

+ 39 - 48
app/controller/api/Notify.php

@@ -405,7 +405,7 @@ class Notify
405
                                 $jf_amount_mine = $user_data['score'] + $gx_jf;
405
                                 $jf_amount_mine = $user_data['score'] + $gx_jf;
406
 
406
 
407
 
407
 
408
-                                Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
408
+                                //Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
409
 
409
 
410
                                 $this->bill_user_log($user_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
410
                                 $this->bill_user_log($user_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
411
 
411
 
@@ -580,6 +580,8 @@ class Notify
580
                                     $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
580
                                     $yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
581
                                     $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
581
                                     $fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
582
 
582
 
583
+
584
+                                    $this->con_log($spread_data['uid'],round($gx_jf,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
583
                                     //养老金
585
                                     //养老金
584
                                     $this->bill_user_log($spread_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
586
                                     $this->bill_user_log($spread_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
585
                                     //佣金
587
                                     //佣金
@@ -675,42 +677,7 @@ class Notify
675
 
677
 
676
                             }
678
                             }
677
 
679
 
678
-                            // if($store_order_data['mer_id'] == 496){
679
-
680
-                            //     $user_data = Db::name("user")->where("uid", $store_order_data['uid'])->find();
681
-                            //     $fzone_paytype = json_decode($store_order_data['fzone_paytype'],true);
682
-
683
-                            //     //会员专区的现金+VR支付
684
-                            //     if($fzone_paytype['type'] == 'a3'){
685
-                                  
686
-
687
-                            //         //会员专区,给用户升级判断
688
-                            //         $orderList = Db::name("store_order")->where("uid", $uid)->where("mer_id",496)->where("status", "in", [0, 1, 2, 3])->select();
689
-                            //         // 初始化总和变量
690
-                            //         $totalPayPrice = 0;
691
-
692
-                            //         // 遍历查询结果
693
-                            //         foreach ($orderList as $order) {
694
-
695
-
696
-                            //             // 累加 pay_price
697
-                            //             $totalPayPrice += $order['pay_price'];
698
-                            //         }
699
-                            //         $userdata = Db::name("user")->where("uid", $uid)->find();
700
-
701
-                            //         if($totalPayPrice >= 1180 && $totalPayPrice < 11800){
702
-
703
-                            //             if( $userdata['user_group'] <= 1){
704
-                            //                 Db::name("user")->where("uid", $uid)->update(["user_group"=>2]);
705
-                            //             }
706
-
707
-                            //         }else if($totalPayPrice >= 11800){
708
-                            //             if( $userdata['user_group'] <= 2){
709
-                            //                 Db::name("user")->where("uid", $uid)->update(["user_group"=>3]);
710
-                            //             }
711
-                            //         }
712
-                            //     }
713
-                            // }
680
+                         
714
 
681
 
715
                             //判断是否是精彩生活区的商品
682
                             //判断是否是精彩生活区的商品
716
                             if($store_order_data['mer_id'] == 439){
683
                             if($store_order_data['mer_id'] == 439){
@@ -1452,22 +1419,51 @@ class Notify
1452
     }
1419
     }
1453
 
1420
 
1454
     //添加推广佣金/养老金日志(养老金金额)
1421
     //添加推广佣金/养老金日志(养老金金额)
1455
-    public function bill_user_log($uid,$num,$order_id,$comm_order_type,$order_sn,$mark,$merid,$ds=1){
1422
+    public function bill_user_log($uid,$num,$order_id,$comm_order_type,$order_sn,$mark,$merid,$ds=0){
1456
 
1423
 
1457
         $con_data = Db::name('user')->where("uid",$uid)->find();
1424
         $con_data = Db::name('user')->where("uid",$uid)->find();
1458
         //如果是会员专区就即刻到账
1425
         //如果是会员专区就即刻到账
1459
         $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->find();
1426
         $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->find();
1460
-        if($order_from_mer['mer_id'] == 496 && $comm_order_type==3){
1461
-            // Db::name('user')->where("order_id",$order_id)->find();
1462
-            Db::name('user')->where("uid",$con_data['uid'])->update(['brokerage_price'=> $con_data['brokerage_price'] + $num]);
1427
+
1428
+        $sm_status = 0;//储存当前用户是否有实名的状态
1429
+
1430
+        if($order_from_mer['mer_id'] == 496){
1431
+        
1432
+            //如果是会员区的直推就即刻到账
1433
+            if($comm_order_type == 3){
1434
+                Db::name('user')->where("uid",$con_data['uid'])->update(['brokerage_price'=> $con_data['brokerage_price'] + $num]);
1435
+            }
1436
+            //如果是会员区的养老金,查看是否有实名,如果实名就改变订单状态和user-bill的状态
1437
+            if($comm_order_type == 5){
1438
+
1439
+                //当前用户是否有实名,然后改变user_bill和order_store的gzc状态
1440
+                $get_cer_datas = Db::name('user_certification')->where("uid",$uid)->find();
1441
+                if(!empty($get_cer_datas)){
1442
+                    if(!empty($get_cer_datas['user_card'])){
1443
+
1444
+                        $sm_status = 1;
1445
+                        $ds = 1;
1446
+                        $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>1]);
1447
+                       
1448
+                    }else{
1449
+                        $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>0]);
1450
+                    }
1451
+                }
1452
+
1453
+                
1454
+            }
1455
+           
1463
         }
1456
         }
1464
 
1457
 
1465
 
1458
 
1466
         $name = '';
1459
         $name = '';
1460
+       
1467
         if($comm_order_type==3){
1461
         if($comm_order_type==3){
1468
             $name = '直推奖';
1462
             $name = '直推奖';
1463
+            $ds = 1;
1469
         }else if($comm_order_type==5){
1464
         }else if($comm_order_type==5){
1470
             $name = '养老金';
1465
             $name = '养老金';
1466
+            //$user_bill_status = Db::name('store_order')->where("order_id",$order_id)->update(['gzc'=>1]);
1471
         }
1467
         }
1472
 
1468
 
1473
         $bill = [
1469
         $bill = [
@@ -1481,7 +1477,7 @@ class Notify
1481
             'balance'=>0,//剩余
1477
             'balance'=>0,//剩余
1482
             'mark'=>$mark,//备注
1478
             'mark'=>$mark,//备注
1483
             'create_time'=>date('Y-m-d H:i:s'),//添加时间
1479
             'create_time'=>date('Y-m-d H:i:s'),//添加时间
1484
-            'status'=>$ds,//0待确定,1有效,-1无效
1480
+            'status'=> $ds,//0待确定,1有效,-1无效
1485
             'commission_type'=>$comm_order_type,//佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\r\n5 养老金√ 6 广告费
1481
             'commission_type'=>$comm_order_type,//佣金类型 1代理费 2 消费佣金 3直推奖√ 4辖区佣金\r\n5 养老金√ 6 广告费
1486
             //7 跨店奖励√ 8平台奖励 9渠道商\r\n10 推荐创客收益√ 11分红奖金√ 12代理区域收益√ 13消费循环佣金
1482
             //7 跨店奖励√ 8平台奖励 9渠道商\r\n10 推荐创客收益√ 11分红奖金√ 12代理区域收益√ 13消费循环佣金
1487
             //14-推荐代理收益√ 15邀请小区团长升级√ 16大v分享奖√ 17创客合伙人√ 18积分奖励√ 19创客补贴√’
1483
             //14-推荐代理收益√ 15邀请小区团长升级√ 16大v分享奖√ 17创客合伙人√ 18积分奖励√ 19创客补贴√’
@@ -1492,20 +1488,15 @@ class Notify
1492
             'source'=>0,//1线下 0线上
1488
             'source'=>0,//1线下 0线上
1493
             'order_type'=>1,//1自营  2 第三方  订单类型
1489
             'order_type'=>1,//1自营  2 第三方  订单类型
1494
             'is_red_brokerage'=>0,//1红积分对冲佣金 0正常佣金
1490
             'is_red_brokerage'=>0,//1红积分对冲佣金 0正常佣金
1495
-            'gzc'=>3,//养老金是否已进入公证处log表0:未进入。1:已进入
1491
+            'gzc'=> $sm_status,//养老金是否已进入公证处log表0:未进入。1:已进入
1496
             'take_time'=>'',//结算时间
1492
             'take_time'=>'',//结算时间
1497
             'district_id'=>'',//
1493
             'district_id'=>'',//
1498
             'street_id'=>'',//
1494
             'street_id'=>'',//
1499
             'month'=>'',//月份
1495
             'month'=>'',//月份
1500
 
1496
 
1501
-
1502
         ];
1497
         ];
1503
 
1498
 
1504
         Db::name('user_bill')->insert($bill);
1499
         Db::name('user_bill')->insert($bill);
1505
-
1506
-
1507
-
1508
-
1509
         
1500
         
1510
     }
1501
     }
1511
 
1502