Преглед на файлове

计划任务-放开,将未进入公证处的数据划入公证处明细列表

sunxbiao преди 1 година
родител
ревизия
df7e1d0d26
променени са 1 файла, в които са добавени 17 реда и са изтрити 1 реда
  1. 17 1
      app/command/PensionTasks.php

+ 17 - 1
app/command/PensionTasks.php

@@ -18,6 +18,9 @@ use Carbon\Carbon;
18
 use think\console\Command;
18
 use think\console\Command;
19
 use think\console\Input;
19
 use think\console\Input;
20
 use think\console\Output;
20
 use think\console\Output;
21
+use think\db\exception\DataNotFoundException;
22
+use think\db\exception\DbException;
23
+use think\db\exception\ModelNotFoundException;
21
 use think\Exception;
24
 use think\Exception;
22
 use think\facade\Db;
25
 use think\facade\Db;
23
 use think\facade\Log;
26
 use think\facade\Log;
@@ -64,7 +67,7 @@ class PensionTasks extends Command
64
 //            $this->doThridVipOrderGzc($nowTime, $timeLimit = 30);
67
 //            $this->doThridVipOrderGzc($nowTime, $timeLimit = 30);
65
 //            $this->doThridDyOrderGzc($nowTime, $timeLimit = 30);
68
 //            $this->doThridDyOrderGzc($nowTime, $timeLimit = 30);
66
 //            $this->doThridHfOrderGzc($nowTime, $timeLimit = 30);
69
 //            $this->doThridHfOrderGzc($nowTime, $timeLimit = 30);
67
-//            $this->billGzcAdd($nowTime);
70
+            $this->billGzcAdd($nowTime);
68
             //升级
71
             //升级
69
 //            $this -> doUpgrade();
72
 //            $this -> doUpgrade();
70
         } catch (\Throwable $e) {
73
         } catch (\Throwable $e) {
@@ -87,10 +90,23 @@ class PensionTasks extends Command
87
         $OrderGzcRepository      = app()->make(OrderGzcRepository::class);
90
         $OrderGzcRepository      = app()->make(OrderGzcRepository::class);
88
         $OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
91
         $OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
89
         $StoreOrderRepository    = app()->make(StoreOrderRepository::class);
92
         $StoreOrderRepository    = app()->make(StoreOrderRepository::class);
93
+        $testUserIdList = [];
94
+        /** @var UserRepository $userRepository */
95
+        $userRepository = app()->make(UserRepository::class);
96
+        try {
97
+            $userIdData = $userRepository->selectWhere(['test_user' => 1], 'uid')->toArray();
98
+            if (!empty($userIdData)) {
99
+                $testUserIdList = array_column($userIdData, 'uid');
100
+            }
101
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $e) {
102
+
103
+        }
104
+
90
         $cursor = Db::name('user_bill')
105
         $cursor = Db::name('user_bill')
91
         ->where('status', 1)
106
         ->where('status', 1)
92
         ->where('is_gzc', 0)
107
         ->where('is_gzc', 0)
93
         ->where('commission_type', 5)
108
         ->where('commission_type', 5)
109
+        ->whereNotIn('uid', $testUserIdList)
94
         ->select()->toArray();
110
         ->select()->toArray();
95
         if($cursor) {
111
         if($cursor) {
96
             foreach ($cursor as $bill) {
112
             foreach ($cursor as $bill) {