Просмотр исходного кода

计划任务-完善将养老金推入公证处明细表

sunxbiao 1 год назад
Родитель
Сommit
d95cb1b3ff
1 измененных файлов с 13 добавлено и 9 удалено
  1. 13 9
      app/command/GzcAddByBillCommand.php

+ 13 - 9
app/command/GzcAddByBillCommand.php

@@ -59,18 +59,23 @@ class GzcAddByBillCommand extends Command
59
 
59
 
60
         }
60
         }
61
 
61
 
62
-        $cursor = Db::name('user_bill')
63
-            ->where('status', 1)
64
-            ->where('is_gzc', 0)
65
-            ->where('commission_type', 5)
66
-            ->whereNotIn('uid', $testUserIdList)
67
-            ->select()->toArray();
68
-        if($cursor) {
62
+        try {
63
+            $cursor = Db::name('user_bill')
64
+                ->where('status', 1)
65
+                ->where('is_gzc', 0)
66
+                ->where('commission_type', 5)
67
+                ->whereNotIn('uid', $testUserIdList)
68
+                ->select();
69
+        } catch (DataNotFoundException|ModelNotFoundException|DbException $e) {
70
+
71
+        }
72
+
73
+        if(!empty($cursor)) {
69
             foreach ($cursor as $bill) {
74
             foreach ($cursor as $bill) {
70
                 $type_shop = $bill['type_shop'] ?? 0;
75
                 $type_shop = $bill['type_shop'] ?? 0;
71
                 switch ($type_shop){
76
                 switch ($type_shop){
72
                     case "0":
77
                     case "0":
73
-                        $online = $cursor = Db::table('rrx_store_order')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->where('paid', 1)->find();
78
+                        $online = Db::table('rrx_store_order')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->where('paid', 1)->find();
74
                         break;
79
                         break;
75
                     case "1":
80
                     case "1":
76
                         $online = Db::table('rrx_order_pdd')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
81
                         $online = Db::table('rrx_order_pdd')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->find();
@@ -107,7 +112,6 @@ class GzcAddByBillCommand extends Command
107
                             ->where('status', 1)
112
                             ->where('status', 1)
108
                             ->find();
113
                             ->find();
109
                         if (!empty($online)) {
114
                         if (!empty($online)) {
110
-                            $online = $online->toArray();
111
                             $online['order_sn'] = $online['out_trade_no'];
115
                             $online['order_sn'] = $online['out_trade_no'];
112
                         }
116
                         }
113
                         break;
117
                         break;