jason 6 сар өмнө
parent
commit
0b47f75d6d

+ 13 - 10
application/api/controller/Test.php

@@ -36,17 +36,20 @@ class Test
         $list = $productTransfer::where('status', ProductTransfer::Normal)->where('order_no', '')->select();
 
         foreach ($list as $item) {
-           
-          
-            //取消转让订单
-            $productOrder->where('id', $item['order_id'])->update(['status'=> 1]);
-       
-            //修改:类型状态
-            $item->status = 0;
-            $item->save();
+            $check_pro = $productOrder
+                ->where('id', $item['order_id'])
+                ->where('type_id', 1)
+                ->where('status', 2)
+                ->find();
+            if (!empty($check_pro)) {
+                //取消转让订单
+                $productOrder->where('id', $item['order_id'])->update(['status'=> 1]);
+
+                //修改:类型状态
+                $item->status = 0;
+                $item->save();
+            }
         }
-    
- 
     }
 
     /*