shish 2 жил өмнө
parent
commit
e3982a3710

+ 7 - 5
console/controllers/OrderController.php

@@ -59,14 +59,16 @@ class OrderController extends Controller
         //查询已经过期10天的订单
         $query->where(['status' => 3])->andWhere(['>', 'fhTime', $startDate])->andWhere(['<=', 'fhTime', $endDate]);
         $query->orderBy('deadline ASC');
-        foreach ($query->batch() as $batchOrder) {
-            foreach ($batchOrder as $order) {
+        foreach ($query->batch() as $batchCg) {
+            echo $startDate . ' ' . $endDate;
+            print_r($batchCg);
+            foreach ($batchCg as $cg) {
                 $connection = Yii::$app->db;
                 $transaction = $connection->beginTransaction();
-                $orderSn = $order['orderSn'] ?? '';
-                $cgId = $order['id'] ?? 0;
+                $orderSn = $cg['orderSn'] ?? '';
+                $id = $cg['id'] ?? 0;
                 try {
-                    $info = PurchaseClass::getById($cgId, true);
+                    $info = PurchaseClass::getById($id, true);
                     if (!empty($info)) {
                         PurchaseClass::confirmTake($info);
                     }