Explorar el Código

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

sunxbiao hace 1 año
padre
commit
d95cb1b3ff
Se han modificado 1 ficheros con 13 adiciones y 9 borrados
  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 74
             foreach ($cursor as $bill) {
70 75
                 $type_shop = $bill['type_shop'] ?? 0;
71 76
                 switch ($type_shop){
72 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 79
                         break;
75 80
                     case "1":
76 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 112
                             ->where('status', 1)
108 113
                             ->find();
109 114
                         if (!empty($online)) {
110
-                            $online = $online->toArray();
111 115
                             $online['order_sn'] = $online['out_trade_no'];
112 116
                         }
113 117
                         break;