xialei пре 1 година
родитељ
комит
0fe4e67006
1 измењених фајлова са 354 додато и 226 уклоњено
  1. 354 226
      app/command/PensionTasks.php

+ 354 - 226
app/command/PensionTasks.php

@@ -58,6 +58,7 @@ class PensionTasks extends Command
58
             $this->doThridVipOrderGzc($nowTime, $timeLimit = 2);
58
             $this->doThridVipOrderGzc($nowTime, $timeLimit = 2);
59
             $this->doThridDyOrderGzc($nowTime, $timeLimit = 2);
59
             $this->doThridDyOrderGzc($nowTime, $timeLimit = 2);
60
             $this->doThridHfOrderGzc($nowTime, $timeLimit = 2);
60
             $this->doThridHfOrderGzc($nowTime, $timeLimit = 2);
61
+            $this->billGzcAdd($nowTime);
61
             //升级
62
             //升级
62
 //            $this -> doUpgrade();
63
 //            $this -> doUpgrade();
63
         } catch (\Throwable $e) {
64
         } catch (\Throwable $e) {
@@ -68,6 +69,109 @@ class PensionTasks extends Command
68
         $output->writeln('pensiontask');
69
         $output->writeln('pensiontask');
69
     }
70
     }
70
 
71
 
72
+
73
+    /**
74
+     * 线下支付订单公证处IN10入账
75
+     * @param $nowTime
76
+     * author: php迷途小书童
77
+     * created: 2021/3/20 9:26
78
+     */
79
+    public function billGzcAdd($nowTime)
80
+    {
81
+        $OrderGzcRepository      = app()->make(OrderGzcRepository::class);
82
+        $OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
83
+        $StoreOrderRepository    = app()->make(StoreOrderRepository::class);
84
+        $cursor = Db::table('user_bill')
85
+        ->where('status', 1)
86
+        ->where('is_gzc', 0)
87
+        ->where('commission_type', 5)
88
+        ->select()->toArray();
89
+        foreach ($cursor as $bill) {
90
+            $type_shop = $bill['type_shop'] ?? 0;
91
+
92
+            switch ($type_shop){
93
+                case "0":
94
+                    $online = $cursor = Db::table('rrx_store_order')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->where('paid', 1)->find();
95
+                    break;
96
+                case "1":
97
+                    $online = Db::table('rrx_order_pdd')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
98
+                    break;
99
+                case "2":
100
+                    $online =  Db::table('rrx_order_vip')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
101
+                    break;
102
+                case "3":
103
+                    $online = Db::table('rrx_order_su')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
104
+                    break;
105
+                case "4":
106
+                    $online = '';
107
+                    break;
108
+                case "5":
109
+                    $online = Db::table('rrx_order_tb')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
110
+                    break;
111
+                case "6":
112
+                    $online = Db::table('rrx_order_jd')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
113
+                    break;
114
+                case "7":
115
+                    $online = '';
116
+                    break;
117
+                case "8":
118
+                    $online = '';
119
+                    break;
120
+                case "9":
121
+                    $online = Db::table('rrx_order_huafei')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
122
+                    break;
123
+                default:
124
+                    $online = Db::table('rrx_store_order')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->where('paid', 1)->find();
125
+            }
126
+
127
+            if (!$online) {
128
+                Log::info($bill['uid'] . '查询不到订单');
129
+                continue;
130
+            }   
131
+
132
+            $certification = UserCertification::getInstance()->where('uid', $bill['uid'])->find();
133
+            if (!$certification) {
134
+                Log::info($online['uid'] . '没有实名认证');
135
+                continue;
136
+            }   
137
+
138
+            $pension = $bill['number'] ?? 0;
139
+            if ($pension <= 0) {
140
+                Log::info($online['order_sn'] . 'pension' . $pension);
141
+                continue;
142
+            }
143
+
144
+            //新增入账明细记录
145
+            $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
146
+            $create    = [
147
+                'uid'          => $online['uid'],
148
+                'platform_no'  => $orderId,
149
+                'account_type' => $online['pay_type'] == 1 ? 3 : 2,
150
+                'user_name'    => $certification['user_name'],
151
+                'mobile'       => $certification['mobile'],
152
+                'user_card'    => $certification['user_card'],
153
+                'pension'      => $pension,
154
+                'order_type'   => 2,
155
+                'out_trade_no' => $online['order_sn'],
156
+                'link_id'=> $bill['bill_id']
157
+            ];
158
+            $test_user = Db::name('user')->where('uid', $online['uid'])->value('test_user');
159
+            $check     = Db::name("gzc_logs")->where("link_id", $bill['id'])->where("order_type", 2)->count();
160
+            if ($test_user == 0 && $check <= 0) {
161
+                $OrderGzcRepository->create($create);
162
+                Db::name('user_bill')
163
+                ->where('bill_id', $bill['bill_id'])
164
+                ->where('commission_type', 5)
165
+                ->update([
166
+                    'is_gzc'          => 1
167
+                ]);
168
+            }
169
+        }
170
+
171
+    }
172
+
173
+
174
+
71
     /**
175
     /**
72
      * 线下支付订单公证处IN10入账
176
      * 线下支付订单公证处IN10入账
73
      * @param $nowTime
177
      * @param $nowTime
@@ -108,56 +212,52 @@ class PensionTasks extends Command
108
                 Log::info($offline['pay_user_id'] . '未绑定用户');
212
                 Log::info($offline['pay_user_id'] . '未绑定用户');
109
                 continue;
213
                 continue;
110
             }
214
             }
111
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
112
-            if (!$certification) {
113
-                Log::info($offline['pay_user_id'] . '未实名认证');
114
-                continue;
115
-            }
215
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
216
+            // if (!$certification) {
217
+            //     Log::info($offline['pay_user_id'] . '未实名认证');
218
+            //     continue;
219
+            // }
116
             //查询养老金金额
220
             //查询养老金金额
117
             $UserBillRepository = app()->make(UserBillRepository::class);
221
             $UserBillRepository = app()->make(UserBillRepository::class);
118
             $bill               = $UserBillRepository->getWhere(['uid' => $uid, 'link_id' => $offline['id'], 'order_sn' => $offline['out_trade_no'], 'title' => '养老金']);
222
             $bill               = $UserBillRepository->getWhere(['uid' => $uid, 'link_id' => $offline['id'], 'order_sn' => $offline['out_trade_no'], 'title' => '养老金']);
119
 
223
 
120
-//            if ($bill->status == 0) {
121
-//                Log::info($offline['out_trade_no'] . 'pension未交年费');
122
-//                continue;
123
-//            }
124
-
125
             $pension = $bill->number ?? 0;
224
             $pension = $bill->number ?? 0;
126
-            if ($pension <= 0) {
127
-                Log::info($offline['out_trade_no'] . 'pension' . $pension);
128
-                continue;
129
-            }
225
+            // if ($pension <= 0) {
226
+            //     Log::info($offline['out_trade_no'] . 'pension' . $pension);
227
+            //     continue;
228
+            // }
130
 
229
 
131
-            Db::transaction(function () use ($uid, $certification, $accountType, $offline, $OrderGzcRepository, $OrderMerchantRepository, $pension, $StoreOrderRepository) {
230
+            // Db::transaction(function () use ($uid, $certification, $accountType, $offline, $OrderGzcRepository, $OrderMerchantRepository, $pension, $StoreOrderRepository) {
231
+            Db::transaction(function () use ($uid, $accountType, $offline, $OrderGzcRepository, $OrderMerchantRepository, $pension, $StoreOrderRepository) {
132
                 $order                  = OrderMerchant::getInstance()->find($offline['id']);
232
                 $order                  = OrderMerchant::getInstance()->find($offline['id']);
133
                 $order->gzc             = 1;
233
                 $order->gzc             = 1;
134
                 $order->is_settlement   = 1;
234
                 $order->is_settlement   = 1;
135
                 $order->settlement_time = date('Y-m-d H:i:s');
235
                 $order->settlement_time = date('Y-m-d H:i:s');
136
                 $order->save();
236
                 $order->save();
137
                 //新增入账明细记录
237
                 //新增入账明细记录
138
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
139
-                $create    = [
140
-                    'uid'          => $uid,
141
-                    'platform_no'  => $orderId,
142
-                    'account_type' => $accountType,
143
-                    'user_name'    => $certification['user_name'],
144
-                    'mobile'       => $certification['mobile'],
145
-                    'user_card'    => $certification['user_card'],
146
-                    'pension'      => $pension,
147
-                    'order_type'   => 1,
148
-                    'out_trade_no' => $offline['out_trade_no']
149
-                ];
150
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
151
-                if ($test_user == 0) {
152
-                    $OrderGzcRepository->create($create);
153
-                }
154
-                // 养老金区域奖励
155
-                $order_data = [
156
-                    'pay_price'        => $pension,
157
-                    'user_address_ids' => $offline['user_address_ids'],
158
-                    'uid'              => $offline['uid'],
159
-                    'order_sn'         => $offline['out_trade_no']
160
-                ];
238
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
239
+                // $create    = [
240
+                //     'uid'          => $uid,
241
+                //     'platform_no'  => $orderId,
242
+                //     'account_type' => $accountType,
243
+                //     'user_name'    => $certification['user_name'],
244
+                //     'mobile'       => $certification['mobile'],
245
+                //     'user_card'    => $certification['user_card'],
246
+                //     'pension'      => $pension,
247
+                //     'order_type'   => 1,
248
+                //     'out_trade_no' => $offline['out_trade_no']
249
+                // ];
250
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
251
+                // if ($test_user == 0) {
252
+                //     $OrderGzcRepository->create($create);
253
+                // }
254
+                // // 养老金区域奖励
255
+                // $order_data = [
256
+                //     'pay_price'        => $pension,
257
+                //     'user_address_ids' => $offline['user_address_ids'],
258
+                //     'uid'              => $offline['uid'],
259
+                //     'order_sn'         => $offline['out_trade_no']
260
+                // ];
161
 //                $StoreOrderRepository->area_manage_details($order_data, 0, 2);
261
 //                $StoreOrderRepository->area_manage_details($order_data, 0, 2);
162
 
262
 
163
 
263
 
@@ -469,48 +569,53 @@ class PensionTasks extends Command
469
                 }
569
                 }
470
             }
570
             }
471
 
571
 
472
-            $certification = UserCertification::getInstance()->where('uid', $online['uid'])->find();
473
-            if (!$certification) {
474
-                Log::info($online['uid'] . '没有实名认证');
475
-                continue;
476
-            }   
572
+            // $certification = UserCertification::getInstance()->where('uid', $online['uid'])->find();
573
+            // if (!$certification) {
574
+            //     Log::info($online['uid'] . '没有实名认证');
575
+            //     continue;
576
+            // }   
477
             //查询养老金金额
577
             //查询养老金金额
478
             $UserBillRepository = app()->make(UserBillRepository::class);
578
             $UserBillRepository = app()->make(UserBillRepository::class);
479
             $bill               = $UserBillRepository->getWhere(['uid' => $online['uid'], 'link_id' => $online['order_id'], 'order_sn' => $online['order_sn'], 'commission_type' => 5]);
579
             $bill               = $UserBillRepository->getWhere(['uid' => $online['uid'], 'link_id' => $online['order_id'], 'order_sn' => $online['order_sn'], 'commission_type' => 5]);
480
 
580
 
481
             $pension = $bill->number ?? 0;
581
             $pension = $bill->number ?? 0;
482
-            if ($pension <= 0) {
483
-                Log::info($online['order_sn'] . 'pension' . $pension);
484
-                continue;
485
-            }
582
+            // if ($pension <= 0) {
583
+            //     Log::info($online['order_sn'] . 'pension' . $pension);
584
+            //     continue;
585
+            // }
486
             //首信易分账
586
             //首信易分账
487
             // $StoreOrderRepository = app()->make(StoreOrderRepository::class);
587
             // $StoreOrderRepository = app()->make(StoreOrderRepository::class);
488
             // if ($online['pay_type'] > 0) {
588
             // if ($online['pay_type'] > 0) {
489
             //     $StoreOrderRepository->splitOrder($online);
589
             //     $StoreOrderRepository->splitOrder($online);
490
             // }
590
             // }
491
 
591
 
492
-            Db::transaction(function () use ($certification, $online, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
592
+            Db::transaction(function () use ($online, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
493
                 //新增入账明细记录
593
                 //新增入账明细记录
494
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
495
-                $create    = [
496
-                    'uid'          => $online['uid'],
497
-                    'platform_no'  => $orderId,
498
-                    'account_type' => $online['pay_type'] == 1 ? 3 : 2,
499
-                    'user_name'    => $certification['user_name'],
500
-                    'mobile'       => $certification['mobile'],
501
-                    'user_card'    => $certification['user_card'],
502
-                    'pension'      => $pension,
503
-                    'order_type'   => 2,
504
-                    'out_trade_no' => $online['order_sn']
505
-                ];
506
-                $test_user = Db::name('user')->where('uid', $online['uid'])->value('test_user');
507
-                $check     = Db::name("gzc_logs")->where("out_trade_no", $online['order_sn'])->where("order_type", 2)->count();
508
-                if ($test_user == 0 && $check <= 0) {
509
-                    $OrderGzcRepository->create($create);
510
-                }
594
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
595
+                // $create    = [
596
+                //     'uid'          => $online['uid'],
597
+                //     'platform_no'  => $orderId,
598
+                //     'account_type' => $online['pay_type'] == 1 ? 3 : 2,
599
+                //     'user_name'    => $certification['user_name'],
600
+                //     'mobile'       => $certification['mobile'],
601
+                //     'user_card'    => $certification['user_card'],
602
+                //     'pension'      => $pension,
603
+                //     'order_type'   => 2,
604
+                //     'out_trade_no' => $online['order_sn']
605
+                // ];
606
+                // $test_user = Db::name('user')->where('uid', $online['uid'])->value('test_user');
607
+                // $check     = Db::name("gzc_logs")->where("out_trade_no", $online['order_sn'])->where("order_type", 2)->count();
608
+                // if ($test_user == 0 && $check <= 0) {
609
+                //     $OrderGzcRepository->create($create);
610
+                // }
511
                 $order                  = StoreOrder::getInstance()->find($online['order_id']);
611
                 $order                  = StoreOrder::getInstance()->find($online['order_id']);
512
                 $order->gzc             = 1;
612
                 $order->gzc             = 1;
513
                 $order->save();
613
                 $order->save();
614
+                Db::name('user_bill')
615
+                ->where('order_sn', $online['order_sn'])
616
+                ->where('commission_type', 5)
617
+                ->update(['status'=> 1]);
618
+
514
                 // 养老金区域奖励
619
                 // 养老金区域奖励
515
 //                $order_data = [
620
 //                $order_data = [
516
 //                    'pay_price'        => $pension,
621
 //                    'pay_price'        => $pension,
@@ -523,7 +628,7 @@ class PensionTasks extends Command
523
             });
628
             });
524
         }
629
         }
525
 
630
 
526
-        // 普通订单(红包,积分,京东,佣金,复购金,养老金,贡献值)
631
+        // 普通订单(红包,积分,京东,佣金,复购金,贡献值)
527
         $cursor = Db::table('rrx_store_order')->where('paid', 1)->where('is_settlement', 0)->where('pay_type', 'in', '0,1,2,4')->cursor();
632
         $cursor = Db::table('rrx_store_order')->where('paid', 1)->where('is_settlement', 0)->where('pay_type', 'in', '0,1,2,4')->cursor();
528
         $StoreOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
633
         $StoreOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
529
         $OrderMerchantRepository    = app()->make(OrderMerchantRepository::class);
634
         $OrderMerchantRepository    = app()->make(OrderMerchantRepository::class);
@@ -743,33 +848,36 @@ class PensionTasks extends Command
743
             $uid = $thrid['uid'];
848
             $uid = $thrid['uid'];
744
             if (!$uid)
849
             if (!$uid)
745
                 continue;
850
                 continue;
746
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
747
-            if (!$certification) {
748
-                Log::info('用户ID' . $uid . '未实名认证');
749
-                continue;
750
-            }
851
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
852
+            // if (!$certification) {
853
+            //     Log::info('用户ID' . $uid . '未实名认证');
854
+            //     continue;
855
+            // }
751
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
856
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
752
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
857
+            Db::transaction(function () use ($uid,  $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
753
                 //新增入账明细记录
858
                 //新增入账明细记录
754
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
755
-                $create    = [
756
-                    'uid'          => $uid,
757
-                    'platform_no'  => $orderId,
758
-                    'user_name'    => $certification['user_name'],
759
-                    'mobile'       => $certification['mobile'],
760
-                    'user_card'    => $certification['user_card'],
761
-                    'pension'      => $pension,
762
-                    'order_type'   => 3,
763
-                    'out_trade_no' => $thrid['order_sn']
764
-                ];
765
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
766
-                if ($test_user == 0) {
767
-                    $OrderGzcRepository->create($create);
768
-                }
859
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
860
+                // $create    = [
861
+                //     'uid'          => $uid,
862
+                //     'platform_no'  => $orderId,
863
+                //     'user_name'    => $certification['user_name'],
864
+                //     'mobile'       => $certification['mobile'],
865
+                //     'user_card'    => $certification['user_card'],
866
+                //     'pension'      => $pension,
867
+                //     'order_type'   => 3,
868
+                //     'out_trade_no' => $thrid['order_sn']
869
+                // ];
870
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
871
+                // if ($test_user == 0) {
872
+                //     $OrderGzcRepository->create($create);
873
+                // }
769
 //                $OrderGzcRepository->create($create);
874
 //                $OrderGzcRepository->create($create);
770
                 Db::table('rrx_order_pdd')
875
                 Db::table('rrx_order_pdd')
771
                     ->update(['gzc' => 1, 'order_pdd_id' => $thrid['order_pdd_id']]);
876
                     ->update(['gzc' => 1, 'order_pdd_id' => $thrid['order_pdd_id']]);
772
-
877
+                Db::name('user_bill')
878
+                    ->where('order_sn', $thrid['order_sn'])
879
+                    ->where('commission_type', 5)
880
+                    ->update(['status'=> 1]);
773
                 // 养老金区域奖励
881
                 // 养老金区域奖励
774
                 $order_data = [
882
                 $order_data = [
775
                     'pay_price'        => $pension,
883
                     'pay_price'        => $pension,
@@ -807,39 +915,43 @@ class PensionTasks extends Command
807
             $uid = $thrid['uid'];
915
             $uid = $thrid['uid'];
808
             if (!$uid)
916
             if (!$uid)
809
                 continue;
917
                 continue;
810
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
811
-            if (!$certification) {
812
-                Log::info('用户ID' . $uid . '未实名认证');
813
-                continue;
814
-            }
918
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
919
+            // if (!$certification) {
920
+            //     Log::info('用户ID' . $uid . '未实名认证');
921
+            //     continue;
922
+            // }
815
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
923
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
816
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
924
+            Db::transaction(function () use ($uid, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
817
                 //新增入账明细记录
925
                 //新增入账明细记录
818
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
819
-                $create    = [
820
-                    'uid'          => $uid,
821
-                    'platform_no'  => $orderId,
822
-                    'user_name'    => $certification['user_name'],
823
-                    'mobile'       => $certification['mobile'],
824
-                    'user_card'    => $certification['user_card'],
825
-                    'pension'      => $pension,
826
-                    'order_type'   => 4,
827
-                    'out_trade_no' => $thrid['order_sn']
828
-                ];
829
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
830
-                if ($test_user == 0) {
831
-                    $OrderGzcRepository->create($create);
832
-                }
926
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
927
+                // $create    = [
928
+                //     'uid'          => $uid,
929
+                //     'platform_no'  => $orderId,
930
+                //     'user_name'    => $certification['user_name'],
931
+                //     'mobile'       => $certification['mobile'],
932
+                //     'user_card'    => $certification['user_card'],
933
+                //     'pension'      => $pension,
934
+                //     'order_type'   => 4,
935
+                //     'out_trade_no' => $thrid['order_sn']
936
+                // ];
937
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
938
+                // if ($test_user == 0) {
939
+                //     $OrderGzcRepository->create($create);
940
+                // }
833
 //                $OrderGzcRepository->create($create);
941
 //                $OrderGzcRepository->create($create);
834
                 Db::table('rrx_order_jd')
942
                 Db::table('rrx_order_jd')
835
                     ->update(['gzc' => 1, 'order_jd_id' => $thrid['order_jd_id']]);
943
                     ->update(['gzc' => 1, 'order_jd_id' => $thrid['order_jd_id']]);
944
+                Db::name('user_bill')
945
+                ->where('order_sn', $thrid['order_sn'])
946
+                ->where('commission_type', 5)
947
+                ->update(['status'=> 1]);
836
                 // 养老金区域奖励
948
                 // 养老金区域奖励
837
-                $order_data = [
838
-                    'pay_price'        => $pension,
839
-                    'user_address_ids' => $thrid['user_address_ids'],
840
-                    'uid'              => $thrid['uid'],
841
-                    'order_sn'         => $thrid['order_sn']
842
-                ];
949
+                // $order_data = [
950
+                //     'pay_price'        => $pension,
951
+                //     'user_address_ids' => $thrid['user_address_ids'],
952
+                //     'uid'              => $thrid['uid'],
953
+                //     'order_sn'         => $thrid['order_sn']
954
+                // ];
843
 //                $StoreOrderRepository->area_manage_details($order_data, 6, 2);
955
 //                $StoreOrderRepository->area_manage_details($order_data, 6, 2);
844
             });
956
             });
845
         }
957
         }
@@ -868,33 +980,36 @@ class PensionTasks extends Command
868
             $uid = $thrid['uid'];
980
             $uid = $thrid['uid'];
869
             if (!$uid)
981
             if (!$uid)
870
                 continue;
982
                 continue;
871
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
872
-            if (!$certification) {
873
-                Log::info('用户ID' . $uid . '未实名认证');
874
-                continue;
875
-            }
983
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
984
+            // if (!$certification) {
985
+            //     Log::info('用户ID' . $uid . '未实名认证');
986
+            //     continue;
987
+            // }
876
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
988
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
877
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
989
+            Db::transaction(function () use ($uid, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
878
                 //新增入账明细记录
990
                 //新增入账明细记录
879
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
880
-                $create    = [
881
-                    'uid'          => $uid,
882
-                    'platform_no'  => $orderId,
883
-                    'user_name'    => $certification['user_name'],
884
-                    'mobile'       => $certification['mobile'],
885
-                    'user_card'    => $certification['user_card'],
886
-                    'pension'      => $pension,
887
-                    'order_type'   => 5,
888
-                    'out_trade_no' => $thrid['order_sn']
889
-                ];
890
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
891
-                if ($test_user == 0) {
892
-                    $OrderGzcRepository->create($create);
893
-                }
991
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
992
+                // $create    = [
993
+                //     'uid'          => $uid,
994
+                //     'platform_no'  => $orderId,
995
+                //     'user_name'    => $certification['user_name'],
996
+                //     'mobile'       => $certification['mobile'],
997
+                //     'user_card'    => $certification['user_card'],
998
+                //     'pension'      => $pension,
999
+                //     'order_type'   => 5,
1000
+                //     'out_trade_no' => $thrid['order_sn']
1001
+                // ];
1002
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1003
+                // if ($test_user == 0) {
1004
+                //     $OrderGzcRepository->create($create);
1005
+                // }
894
 //                $OrderGzcRepository->create($create);
1006
 //                $OrderGzcRepository->create($create);
895
                 Db::table('rrx_order_su')
1007
                 Db::table('rrx_order_su')
896
                     ->update(['gzc' => 1, 'order_su_id' => $thrid['order_su_id']]);
1008
                     ->update(['gzc' => 1, 'order_su_id' => $thrid['order_su_id']]);
897
-
1009
+                Db::name('user_bill')
1010
+                ->where('order_sn', $thrid['order_sn'])
1011
+                ->where('commission_type', 5)
1012
+                ->update(['status'=> 1]);
898
                 // 养老金区域奖励
1013
                 // 养老金区域奖励
899
                 $order_data = [
1014
                 $order_data = [
900
                     'pay_price'        => $pension,
1015
                     'pay_price'        => $pension,
@@ -931,30 +1046,34 @@ class PensionTasks extends Command
931
             $uid = $thrid['uid'];
1046
             $uid = $thrid['uid'];
932
             if (!$uid)
1047
             if (!$uid)
933
                 continue;
1048
                 continue;
934
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
935
-            if (!$certification) {
936
-                Log::info('用户ID' . $uid . '未实名认证');
937
-                continue;
938
-            }
1049
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
1050
+            // if (!$certification) {
1051
+            //     Log::info('用户ID' . $uid . '未实名认证');
1052
+            //     continue;
1053
+            // }
939
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
1054
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
940
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository) {
941
-                //新增入账明细记录
942
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
943
-                $create    = [
944
-                    'uid'          => $uid,
945
-                    'platform_no'  => $orderId,
946
-                    'user_name'    => $certification['user_name'],
947
-                    'mobile'       => $certification['mobile'],
948
-                    'user_card'    => $certification['user_card'],
949
-                    'pension'      => $pension,
950
-                    'order_type'   => 6,
951
-                    'out_trade_no' => $thrid['order_sn']
952
-                ];
953
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
954
-                if ($test_user == 0) {
955
-                    $OrderGzcRepository->create($create);
956
-                }
1055
+            Db::transaction(function () use ($uid, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository) {
1056
+                // //新增入账明细记录
1057
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1058
+                // $create    = [
1059
+                //     'uid'          => $uid,
1060
+                //     'platform_no'  => $orderId,
1061
+                //     'user_name'    => $certification['user_name'],
1062
+                //     'mobile'       => $certification['mobile'],
1063
+                //     'user_card'    => $certification['user_card'],
1064
+                //     'pension'      => $pension,
1065
+                //     'order_type'   => 6,
1066
+                //     'out_trade_no' => $thrid['order_sn']
1067
+                // ];
1068
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1069
+                // if ($test_user == 0) {
1070
+                //     $OrderGzcRepository->create($create);
1071
+                // }
957
                 Db::table('rrx_order_huafei')->update(['gzc' => 1, 'order_tb_id' => $thrid['order_tb_id']]);
1072
                 Db::table('rrx_order_huafei')->update(['gzc' => 1, 'order_tb_id' => $thrid['order_tb_id']]);
1073
+                Db::name('user_bill')
1074
+                ->where('order_sn', $thrid['order_sn'])
1075
+                ->where('commission_type', 5)
1076
+                ->update(['status'=> 1]);
958
             });
1077
             });
959
         }
1078
         }
960
     }
1079
     }
@@ -984,33 +1103,36 @@ class PensionTasks extends Command
984
             $uid = $thrid['uid'];
1103
             $uid = $thrid['uid'];
985
             if (!$uid)
1104
             if (!$uid)
986
                 continue;
1105
                 continue;
987
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
988
-            if (!$certification) {
989
-                Log::info('用户ID' . $uid . '未实名认证');
990
-                continue;
991
-            }
1106
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
1107
+            // if (!$certification) {
1108
+            //     Log::info('用户ID' . $uid . '未实名认证');
1109
+            //     continue;
1110
+            // }
992
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
1111
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
993
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
1112
+            Db::transaction(function () use ($uid, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
994
                 //新增入账明细记录
1113
                 //新增入账明细记录
995
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
996
-                $create    = [
997
-                    'uid'          => $uid,
998
-                    'platform_no'  => $orderId,
999
-                    'user_name'    => $certification['user_name'],
1000
-                    'mobile'       => $certification['mobile'],
1001
-                    'user_card'    => $certification['user_card'],
1002
-                    'pension'      => $pension,
1003
-                    'order_type'   => 6,
1004
-                    'out_trade_no' => $thrid['order_sn']
1005
-                ];
1006
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1007
-                if ($test_user == 0) {
1008
-                    $OrderGzcRepository->create($create);
1009
-                }
1114
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1115
+                // $create    = [
1116
+                //     'uid'          => $uid,
1117
+                //     'platform_no'  => $orderId,
1118
+                //     'user_name'    => $certification['user_name'],
1119
+                //     'mobile'       => $certification['mobile'],
1120
+                //     'user_card'    => $certification['user_card'],
1121
+                //     'pension'      => $pension,
1122
+                //     'order_type'   => 6,
1123
+                //     'out_trade_no' => $thrid['order_sn']
1124
+                // ];
1125
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1126
+                // if ($test_user == 0) {
1127
+                //     $OrderGzcRepository->create($create);
1128
+                // }
1010
 //                $OrderGzcRepository->create($create);
1129
 //                $OrderGzcRepository->create($create);
1011
                 Db::table('rrx_order_tb')
1130
                 Db::table('rrx_order_tb')
1012
                     ->update(['gzc' => 1, 'order_tb_id' => $thrid['order_tb_id']]);
1131
                     ->update(['gzc' => 1, 'order_tb_id' => $thrid['order_tb_id']]);
1013
-
1132
+                Db::name('user_bill')
1133
+                ->where('order_sn', $thrid['order_sn'])
1134
+                ->where('commission_type', 5)
1135
+                ->update(['status'=> 1]);
1014
                 // 养老金区域奖励
1136
                 // 养老金区域奖励
1015
                 $order_data = [
1137
                 $order_data = [
1016
                     'pay_price'        => $pension,
1138
                     'pay_price'        => $pension,
@@ -1046,33 +1168,36 @@ class PensionTasks extends Command
1046
             $uid = $thrid['uid'];
1168
             $uid = $thrid['uid'];
1047
             if (!$uid)
1169
             if (!$uid)
1048
                 continue;
1170
                 continue;
1049
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
1050
-            if (!$certification) {
1051
-                Log::info('用户ID' . $uid . '未实名认证');
1052
-                continue;
1053
-            }
1171
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
1172
+            // if (!$certification) {
1173
+            //     Log::info('用户ID' . $uid . '未实名认证');
1174
+            //     continue;
1175
+            // }
1054
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
1176
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
1055
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
1177
+            Db::transaction(function () use ($uid, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
1056
                 //新增入账明细记录
1178
                 //新增入账明细记录
1057
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1058
-                $create    = [
1059
-                    'uid'          => $uid,
1060
-                    'platform_no'  => $orderId,
1061
-                    'user_name'    => $certification['user_name'],
1062
-                    'mobile'       => $certification['mobile'],
1063
-                    'user_card'    => $certification['user_card'],
1064
-                    'pension'      => $pension,
1065
-                    'order_type'   => 7,
1066
-                    'out_trade_no' => $thrid['order_sn']
1067
-                ];
1068
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1069
-                if ($test_user == 0) {
1070
-                    $OrderGzcRepository->create($create);
1071
-                }
1179
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1180
+                // $create    = [
1181
+                //     'uid'          => $uid,
1182
+                //     'platform_no'  => $orderId,
1183
+                //     'user_name'    => $certification['user_name'],
1184
+                //     'mobile'       => $certification['mobile'],
1185
+                //     'user_card'    => $certification['user_card'],
1186
+                //     'pension'      => $pension,
1187
+                //     'order_type'   => 7,
1188
+                //     'out_trade_no' => $thrid['order_sn']
1189
+                // ];
1190
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1191
+                // if ($test_user == 0) {
1192
+                //     $OrderGzcRepository->create($create);
1193
+                // }
1072
 //                $OrderGzcRepository->create($create);
1194
 //                $OrderGzcRepository->create($create);
1073
                 Db::table('rrx_order_vip')
1195
                 Db::table('rrx_order_vip')
1074
                     ->update(['gzc' => 1, 'order_vip_id' => $thrid['order_vip_id']]);
1196
                     ->update(['gzc' => 1, 'order_vip_id' => $thrid['order_vip_id']]);
1075
-
1197
+                Db::name('user_bill')
1198
+                    ->where('order_sn', $thrid['order_sn'])
1199
+                    ->where('commission_type', 5)
1200
+                    ->update(['status'=> 1]);
1076
                 // 养老金区域奖励
1201
                 // 养老金区域奖励
1077
                 $order_data = [
1202
                 $order_data = [
1078
                     'pay_price'        => $pension,
1203
                     'pay_price'        => $pension,
@@ -1108,32 +1233,35 @@ class PensionTasks extends Command
1108
             $uid = $thrid['uid'];
1233
             $uid = $thrid['uid'];
1109
             if (!$uid)
1234
             if (!$uid)
1110
                 continue;
1235
                 continue;
1111
-            $certification = UserCertification::getInstance()->where('uid', $uid)->find();
1112
-            if (!$certification) {
1113
-                Log::info('用户ID' . $uid . '未实名认证');
1114
-                continue;
1115
-            }
1236
+            // $certification = UserCertification::getInstance()->where('uid', $uid)->find();
1237
+            // if (!$certification) {
1238
+            //     Log::info('用户ID' . $uid . '未实名认证');
1239
+            //     continue;
1240
+            // }
1116
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
1241
             $pension = $ProductRepository->yanglaojin(0, sprintf('%.2f', $thrid['commission']));
1117
-            Db::transaction(function () use ($uid, $certification, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
1118
-                //新增入账明细记录
1119
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1120
-                $create    = [
1121
-                    'uid'          => $uid,
1122
-                    'platform_no'  => $orderId,
1123
-                    'user_name'    => $certification['user_name'],
1124
-                    'mobile'       => $certification['mobile'],
1125
-                    'user_card'    => $certification['user_card'],
1126
-                    'pension'      => $pension,
1127
-                    'order_type'   => 8,
1128
-                    'out_trade_no' => $thrid['order_sn']
1129
-                ];
1130
-                $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1131
-                if ($test_user == 0) {
1132
-                    $OrderGzcRepository->create($create);
1133
-                }
1242
+            Db::transaction(function () use ($uid, $thrid, $pension, $OrderGzcRepository, $OrderMerchantRepository, $StoreOrderRepository) {
1243
+                // //新增入账明细记录
1244
+                // $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1245
+                // $create    = [
1246
+                //     'uid'          => $uid,
1247
+                //     'platform_no'  => $orderId,
1248
+                //     'user_name'    => $certification['user_name'],
1249
+                //     'mobile'       => $certification['mobile'],
1250
+                //     'user_card'    => $certification['user_card'],
1251
+                //     'pension'      => $pension,
1252
+                //     'order_type'   => 8,
1253
+                //     'out_trade_no' => $thrid['order_sn']
1254
+                // ];
1255
+                // $test_user = Db::name('user')->where('uid', $uid)->value('test_user');
1256
+                // if ($test_user == 0) {
1257
+                //     $OrderGzcRepository->create($create);
1258
+                // }
1134
                 Db::table('rrx_order_dy')
1259
                 Db::table('rrx_order_dy')
1135
                     ->update(['gzc' => 1, 'order_dy_id' => $thrid['order_dy_id']]);
1260
                     ->update(['gzc' => 1, 'order_dy_id' => $thrid['order_dy_id']]);
1136
-
1261
+                Db::name('user_bill')
1262
+                    ->where('order_sn', $thrid['order_sn'])
1263
+                    ->where('commission_type', 5)
1264
+                    ->update(['status'=> 1]);
1137
                 // 养老金区域奖励
1265
                 // 养老金区域奖励
1138
                 $order_data = [
1266
                 $order_data = [
1139
                     'pay_price'        => $pension,
1267
                     'pay_price'        => $pension,